{"AccountEnhancements":{"list":{"x-tagGroups":[{"tags":["Account Enhancements"],"name":"cPanel Account"}],"paths":{"/AccountEnhancements/list":{"get":{"parameters":[],"description":"This function lists a cPanel account's [Account Enhancements](https://go.cpanel.net/account-enhancements).","operationId":"AccountEnhancements-list","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"list","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"description":"An object that contains the Account Enhancements that the cPanel account can access","items":{"properties":{"id":{"type":"string","items":{"type":"string"},"description":"The Account Enhancement's id.","example":"sample-enhancement-id"},"name":{"example":"Sample Enhancement","items":{"type":"string"},"description":"The Account Enhancement's name.","type":"string"}}}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"AccountEnhancements"}}}}}}},"x-cpanel-available-version":"cPanel 98","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  AccountEnhancements \\\n  list\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/AccountEnhancements/list"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file AccountEnhancements_list.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/AccountEnhancements_list.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/AccountEnhancements/,\n    q/list/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file AccountEnhancements_list.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/AccountEnhancements_list.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    'AccountEnhancements',\n    'list'\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}"}],"tags":["Account Enhancements"],"summary":"Return all cPanel account's Account Enhancements","x-cpanel-api-version":"UAPI"}}},"tags":[{"name":"Account Enhancements","description":"The Account Enhancement module for UAPI."}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.97.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"has_enhancement":{"x-tagGroups":[{"tags":["Account Enhancements"],"name":"cPanel Account"}],"paths":{"/AccountEnhancements/has_enhancement":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `reason` field for more details."},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"type":"integer","enum":["1","0"],"example":"1","description":"* `1` - The Account Enhancement is assigned to the cPanel account.\n* `0` - The Account Enhancement is not assigned to the cPanel account."},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"module":{"description":"The name of the module called.","example":"AccountEnhancements","type":"string"},"func":{"example":"list","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 98","parameters":[{"description":"The identifier for a specific Account Enhancement.\n\n**Note:**\n\nTo retrieve a list of all Account Enhancements IDs on the server, run the WHM API 1 `list_account_enhancements` function.","schema":{"example":"sample-enhancement-id","type":"string"},"in":"query","name":"id","required":"true"}],"operationId":"AccountEnhancements-has-enhancement","description":"This function returns whether a cPanel account has a specific [Account Enhancement](https://go.cpanel.net/account-enhancements).","x-cpanel-api-version":"UAPI","summary":"Validate Account Enhancement assignment","tags":["Account Enhancements"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  AccountEnhancements \\\n  has_enhancement \\\n  id=account_enhancement\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/AccountEnhancements/has_enhancement?id=account_enhancement","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file AccountEnhancements_has_enhancement.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/AccountEnhancements_has_enhancement.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/AccountEnhancements/,\n    q/has_enhancement/,\n    q/id=account_enhancement/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file AccountEnhancements_has_enhancement.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/AccountEnhancements_has_enhancement.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    'AccountEnhancements',\n    'has_enhancement',\n    array('id' => 'sample_enhancement')\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}"}]}}},"tags":[{"name":"Account Enhancements","description":"The Account Enhancement module for UAPI."}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.97.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"}},"BoxTrapper":{"get_allowlist":{"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"Email","tags":["Spam Prevention (BoxTrapper)"]}],"paths":{"/BoxTrapper/get_allowlist":{"get":{"description":"This function retrieves a list of BoxTrapper allowlist configuration rules. BoxTrapper will deliver emails that match these rules.\n\n**Important:**\n\nWhen you disable the\n[*Receive Mail* role](https://go.cpanel.net/serverroles),\nthe system **disables** this function.","operationId":"BoxTrapper::get_allowlist","parameters":[{"description":"A valid email address on the cPanel account.\n\n**Warning:**\n\nIf you call this function in Webmail, the system overrides this parameter.\nThis parameter defaults to the current email address.","schema":{"format":"email","example":"user@example.com","type":"string"},"name":"email","in":"query","required":"true"}],"x-cpanel-available-version":"cPanel 94","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"metadata":{"properties":{}},"data":{"type":"array","description":"The allowlist configuration rules.","items":{"type":"string","example":"from allowlisted-email\\@domain\\.com","description":"One allowlist rule."}},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"get_allowlist"}}}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_allowlist \\\n  email='user@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_allowlist?email=user%40example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_allowlist.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_allowlist.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/BoxTrapper/,\n    q/get_allowlist/,\n    {\n        'email' => 'user@example.com',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_allowlist.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_allowlist.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    'BoxTrapper',\n    'get_allowlist',\n    array (\n        'email' => 'user@example.com',\n    )\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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Return account BoxTrapper allowlist rules","x-cpanel-api-version":"UAPI"}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.93.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"}},"get_ignorelist":{"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"paths":{"/BoxTrapper/get_ignorelist":{"get":{"summary":"Return account BoxTrapper ignorelist rules","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_ignorelist \\\n  email='user@example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_ignorelist?email=user%40example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_ignorelist.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_ignorelist.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/BoxTrapper/,\n    q/get_ignorelist/,\n    {\n        'email' => 'user@example.com',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_ignorelist.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_ignorelist.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    'BoxTrapper',\n    'get_ignorelist',\n    array (\n        'email' => 'user@example.com',\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"BoxTrapper","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{}},"data":{"type":"array","description":"The ignorelist configuration rules.","items":{"example":"from ignored-email\\@domain\\.com","description":"One ignorelist rule.","type":"string"}},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"description":"The name of the method called.","example":"get_ignorelist","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 94","parameters":[{"description":"A valid email address on the cPanel account.\n\n**Warning:**\n\nIf you call this function in Webmail, the system overrides this parameter.\nThis parameter defaults to the current email address.","schema":{"format":"email","example":"user@example.com","type":"string"},"name":"email","in":"query","required":"true"}],"operationId":"BoxTrapper::get_ignorelist","description":"This function retrieves a list of BoxTrapper ignorelist configuration rules. BoxTrapper will delete messages that match these rules without sending a notification to the sender.\n\n**Important:**\n\nWhen you disable the\n[*Receive Mail* role](https://go.cpanel.net/serverroles),\nthe system **disables** this function."}}},"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.93.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"get_log":{"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/get_log":{"get":{"parameters":[{"name":"email","in":"query","required":"true","description":"The account's email address.\n\n**Important:**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently authenticated email address.","schema":{"type":"string","example":"user@example.com","format":"email"}},{"required":"false","in":"query","name":"date","schema":{"example":"1556812881","format":"unix_timestamp","type":"integer"},"description":"The date for which to return the log file and its contents.\n\n**Note:**\n\nThis parameter defaults to the current date."}],"operationId":"get_log","description":"This function returns the account's BoxTrapper log file and its contents.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_log"},"result":{"properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"date":{"description":"The date for which the system returned the log.","format":"unix_timestamp","example":"1556812881","type":"integer"},"path":{"description":"The log file's filepath. If the log file doesn't exist, the function returns an empty string.","example":"/home/user/etc/example.com/user/boxtrapper/log/05-02-2019.log","type":"string"},"lines":{"items":{"example":"Processing email with trusted transport method.","type":"string"},"description":"An array of lines from the log file. If the log file doesn't exist or if no log lines exist in the file, the function returns an empty array.","type":"array"}}},"status":{"description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"BoxTrapper"}}}}}}},"x-cpanel-available-version":"cPanel 82","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_log \\\n  email='user@example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_log?email=user%40example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_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/BoxTrapper/,\n    q/get_log/,\n    {\n        'email' => 'user@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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_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    'BoxTrapper',\n    'get_log',\n    array (\n        'email' => 'user@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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Return BoxTrapper log file and contents","x-cpanel-api-version":"UAPI"}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"},"openapi":"3.0.2"},"list_queued_messages":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/list_queued_messages":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  list_queued_messages \\\n  email='user@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/list_queued_messages?email=user%40example.com","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_list_queued_messages.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_list_queued_messages.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/BoxTrapper/,\n    q/list_queued_messages/,\n    {\n        'email' => 'user@example.com',\n    }\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_list_queued_messages.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_list_queued_messages.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    'BoxTrapper',\n    'list_queued_messages',\n    array (\n        'email' => 'user@example.com',\n    )\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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Return email account's BoxTrapper queued messages","x-cpanel-api-version":"UAPI","description":"This function returns a list of messages in the account's BoxTrapper queue.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables**\n  this function.","operationId":"list_queued_messages","parameters":[{"description":"The email account for which to retrieve queued messages.\n\n**Important:**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently authenticated email address.","schema":{"example":"user@example.com","format":"email","type":"string"},"name":"email","in":"query","required":"true"},{"schema":{"type":"integer","example":"1556812881","format":"unix_timestamp","default":"the current time"},"description":"The date for which to return queued messages.","required":"false","in":"query","name":"date"}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"description":"Information about each queued message.","items":{"type":"object","properties":{"time":{"description":"The message's creation time.","format":"unix_timestamp","example":"1556812881","type":"integer"},"from":{"type":"string","example":"user@example.com","description":"The sender's email address.","format":"email"},"subject":{"description":"The message's subject.","example":"Email Message Subject","type":"string"},"queuefile":{"example":"example.msg","description":"The message's unique ID.","type":"string"}}},"type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"func":{"example":"list_queued_messages","description":"The name of the method called.","type":"string"}},"type":"object"}}}}}}}}},"set_status":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/set_status":{"get":{"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{}},"data":{"nullable":"true","default":null,"type":"object"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"}}},"module":{"type":"string","description":"The name of the module called.","example":"BoxTrapper"},"func":{"example":"set_status","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"operationId":"set_status","description":"This function enables or disables BoxTrapper for an email account.\n\n**Important:**\n\n  When you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","parameters":[{"required":"true","name":"email","in":"query","schema":{"oneOf":[{"type":"string","example":"user@example.com","format":"email"},{"example":"exampleuser","format":"username","type":"string"}]},"description":"The account's name. This can be an email address or the cPanel user’s username.\n\n**Warning:**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.","example":"user@example.com"},{"required":"true","name":"enabled","in":"query","schema":{"example":"1","enum":["0","1"],"type":"integer"},"description":"Whether to enable or disable BoxTrapper for the email account.\n\n* `1` - Enable BoxTrapper.\n* `0` - **Disable** BoxTrapper."}],"summary":"Enable or disable BoxTrapper for email account","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  set_status \\\n  email='user@example.com' \\\n  enabled='1'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_status?email=user%40example.com&enabled=1","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_status.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_status.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/BoxTrapper/,\n    q/set_status/,\n    {\n        'email' => 'user@example.com',\n        'enabled' => '1',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_status.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_status.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    'BoxTrapper',\n    'set_status',\n    array (\n        'email' => 'user@example.com',\n        'enabled' => '1',\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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"]}}},"tags":[{"description":"The BoxTrapper module for UAPI.","name":"BoxTrapper"},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}]},"get_forwarders":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/get_forwarders":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_forwarders","type":"string"},"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"data":{"description":"The email addresses to which BoxTrapper forwards email.","items":{"example":"user1@example.com, user2@example.com, user3@example.com","type":"string"},"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 86","parameters":[{"description":"The account's email address.\n\n**Important:**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.","schema":{"format":"email","example":"user@example.com","type":"string"},"in":"query","name":"email","required":"true"}],"description":"This function retrieves a list of email addresses to which BoxTrapper forwards email messages.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"get_forwarders","x-cpanel-api-version":"UAPI","summary":"Return all BoxTrapper forwarders","tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_forwarders \\\n  email='user@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_forwarders?email=user%40example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_forwarders.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_forwarders.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/BoxTrapper/,\n    q/get_forwarders/,\n    {\n        'email' => 'user@example.com',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_forwarders.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_forwarders.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    'BoxTrapper',\n    'get_forwarders',\n    array (\n        'email' => 'user@example.com',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}]},"blacklist_messages":{"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"paths":{"/BoxTrapper/blacklist_messages":{"get":{"operationId":"blacklist_messages","description":"This function blacklists email message senders.\n\n**Important:**\n\n  When you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system disables this function.","parameters":[{"schema":{"type":"string","format":"email","example":"user@example.com"},"description":"The email address for which to blacklist messages.\n\n**Warning:**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated user.","required":"true","name":"email","in":"query"},{"schema":{"example":"example.msg","type":"string"},"examples":{"single":{"value":"file1","summary":"Blacklist one filename."},"multiple":{"value":"queuefile=file1&queuefile=file2","summary":"Blacklist multiple filenames."}},"description":"The filename of the email message to blacklist.","required":"true","name":"queuefile","in":"query"}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"data":{"items":{"type":"object","properties":{"email":{"type":"string","example":"user@example.com","description":"The email address that sent the blacklisted message.","format":"email"},"reason":{"description":"A message about the failure or the warning.\n\n**Note:**\n\n The function only returns this value if it doesn't delete the message or experiences issues when it deletes the message.","example":"This is a failure message.","type":"string"},"warning":{"type":"integer","description":"Whether the system experienced issues when it blacklisted the message.\n\n**Note:**\n\n The function only returns this value if it doesn't blacklist the message.","example":"1","enum":["1"]},"matches":{"items":{"type":"string","example":"example.msg"},"description":"An array of messages that the system deleted.","type":"array"},"operator":{"type":"string","example":"blacklist","enum":["blacklist"],"description":"The action that the function performed."},"failed":{"type":"integer","example":"1","enum":["1"],"description":"Whether the system failed to blacklist the message.\n\n**Note:**\n\n The function only returns this value if it doesn't blacklist the message."}}},"description":"An array of objects of blacklisted email information.","type":"array"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details."},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"BoxTrapper","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"blacklist_messages","type":"string"}}}}},"description":"HTTP Request was successful."}},"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  blacklist_messages \\\n  email='user@example.com' \\\n  queuefile='file1'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/blacklist_messages?email=user%40example.com&queuefile=file1"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_blacklist_messages.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_blacklist_messages.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/BoxTrapper/,\n    q/blacklist_messages/,\n    {\n        'email' => 'user@example.com',\n        'queuefile' => 'file1',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_blacklist_messages.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_blacklist_messages.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    'BoxTrapper',\n    'blacklist_messages',\n    array (\n        'email' => 'user@example.com',\n        'queuefile' => 'file1',\n    )\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","summary":"Add email address to BoxTrapper blocked senders"}}},"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The BoxTrapper module for UAPI.","name":"BoxTrapper"},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}]},"get_blocklist":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.93.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/get_blocklist":{"get":{"parameters":[{"in":"query","name":"email","required":"true","description":"A valid email address on the cPanel account.\n\n**Warning:**\n\nIf you call this function in Webmail, the system overrides this parameter.\nThis parameter defaults to the current email address.","schema":{"format":"email","example":"user@example.com","type":"string"}}],"operationId":"BoxTrapper::get_blocklist","description":"This function retrieves a list of BoxTrapper blocklist configuration rules. BoxTrapper will delete messages that match these rules and send a notification to the sender.\n\n**Important:**\n\nWhen you disable the\n[*Receive Mail* role](https://go.cpanel.net/serverroles),\nthe system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"data":{"items":{"description":"One blocklist rule.","example":"from blocklisted-email\\@domain\\.com","type":"string"},"description":"The blocklist configuration rules.","type":"array"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{}}},"type":"object"},"func":{"description":"The name of the method called.","example":"get_blocklist","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 94","tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_blocklist \\\n  email='user@example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_blocklist?email=user%40example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_blocklist.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_blocklist.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/BoxTrapper/,\n    q/get_blocklist/,\n    {\n        'email' => 'user@example.com',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_blocklist.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_blocklist.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    'BoxTrapper',\n    'get_blocklist',\n    array (\n        'email' => 'user@example.com',\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return account BoxTrapper blocklist rules"}}},"tags":[{"description":"The BoxTrapper module for UAPI.","name":"BoxTrapper"},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"save_configuration":{"paths":{"/BoxTrapper/save_configuration":{"get":{"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  save_configuration \\\n  email='user@example.com' \\\n  from_addresses='sender1@test.com,sender2@test.com' \\\n  queue_days='14' \\\n  enable_auto_whitelist='1' \\\n  whitelist_by_association='1'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/save_configuration?email=user%40example.com&from_addresses=sender1%40test.com%2csender2%40test.com&queue_days=14&enable_auto_whitelist=1&whitelist_by_association=1"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_save_configuration.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_save_configuration.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/BoxTrapper/,\n    q/save_configuration/,\n    {\n        'email' => 'user@example.com',\n        'from_addresses' => 'sender1@test.com,sender2@test.com',\n        'queue_days' => '14',\n        'enable_auto_whitelist' => '1',\n        'whitelist_by_association' => '1',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_save_configuration.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_save_configuration.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    'BoxTrapper',\n    'save_configuration',\n    array (\n        'email' => 'user@example.com',\n        'from_addresses' => 'sender1@test.com,sender2@test.com',\n        'queue_days' => '14',\n        'enable_auto_whitelist' => '1',\n        'whitelist_by_association' => '1',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Update email account's BoxTrapper configuration","parameters":[{"required":"true","in":"query","name":"email","schema":{"type":"string","example":"user@example.com","format":"email"},"description":"The account's email address.\n\n**Warning:**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address."},{"required":"true","name":"from_addresses","in":"query","schema":{"example":"sender1@test.com,sender2@test.com","format":"email-csv","type":"string"},"description":"A comma-separated list of email addresses that the system uses when it sends messages back to the original message senders."},{"description":"The account's Apache SpamAssassin™ threshold score. For more information about Apache SpamAssassin threshold scores, read our [Spam Filters](https://go.cpanel.net/cpaneldocsSpamFilters) documentation.\n\n**Note:**\n\nThis parameter defaults to the account's current configuration.","schema":{"type":"number","example":"2.5"},"in":"query","name":"spam_score","required":"false"},{"name":"queue_days","in":"query","required":"true","description":"The number of days to retain log files and queued messages.","schema":{"example":"14","minimum":"1","type":"integer"}},{"schema":{"example":"1","enum":["0","1"],"type":"integer"},"description":"Whether to enable automatic whitelisting for the account.\n\n* `1` - Enable.\n* `0` - Disable.","required":"true","name":"enable_auto_whitelist","in":"query"},{"schema":{"type":"integer","enum":["0","1"],"example":"1"},"description":"Whether to whitelist the email addresses in a message's *To* and *From* sections, including carbon-copied (CC) recipients.\n\n* `1` - Whitelist.\n* `0` - Do **not** whitelist.","required":"true","in":"query","name":"whitelist_by_association"},{"description":"The name of the person who owns the email account.","schema":{"type":"string","example":"User"},"name":"from_name","in":"query","required":"false"}],"description":"This function modifies an account's BoxTrapper configuration.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"save_configuration","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"save_configuration","description":"The name of the method called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"data":{"nullable":"true","default":null,"type":"object"},"status":{"description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 82"}}},"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The BoxTrapper module for UAPI.","name":"BoxTrapper"},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"list_email_templates":{"x-tagGroups":[{"name":"Email","tags":["Spam Prevention (BoxTrapper)"]}],"paths":{"/BoxTrapper/list_email_templates":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"list_email_templates","type":"string"},"result":{"type":"object","properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"array","example":["blacklist","returnverify","verify","verifyreleased"],"items":{"example":"verify","enum":["blacklist","verify","verifyreleased","returnverify"],"type":"string"},"description":"An array of strings representing BoxTrapper message templates.\n* `blacklist` - BoxTrapper responds with this message when a blacklisted address sends an email.\n* `verify` - BoxTrapper responds with this message when an address that does not exist on the whitelist or blacklist sends an email. This message requests a response to confirm that the sender is legitimate.\n* `verifyreleased` - BoxTrapper responds with this message when a person responds to the verify message with an email or a click on the verification link.\n* `returnverify` - BoxTrapper responds with this message when the verification process fails."},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"BoxTrapper"}}}}}}},"x-cpanel-available-version":"cPanel 84","parameters":[],"operationId":"list_email_templates","description":"This function lists the BoxTrapper email templates.\n\n**Important:**\n\nWhen you **disable** the [Receive Mail](https://go.cpanel.net/serverroles) role, the system disables this function.","summary":"Return BoxTrapper email templates","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  list_email_templates\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/list_email_templates","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_list_email_templates.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_list_email_templates.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/BoxTrapper/,\n    q/list_email_templates/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_list_email_templates.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_list_email_templates.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    'BoxTrapper',\n    'list_email_templates'\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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"]}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"process_messages":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"paths":{"/BoxTrapper/process_messages":{"get":{"x-cpanel-api-version":"UAPI","summary":"Run a specific BoxTrapper action for a message","tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  process_messages \\\n  queuefile='example.msg' \\\n  action='blacklist'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/process_messages?queuefile=example.msg&action=blacklist","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_process_messages.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_process_messages.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/BoxTrapper/,\n    q/process_messages/,\n    {\n        'queuefile' => 'example.msg',\n        'action' => 'blacklist',\n    }\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_process_messages.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_process_messages.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    'BoxTrapper',\n    'process_messages',\n    array (\n        'queuefile' => 'example.msg',\n        'action' => 'blacklist',\n    )\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}"}],"responses":{"200":{"content":{"application/json":{"examples":{"function-success":{"value":{"module":"BoxTrapper","errors":null,"apiversion":"3","metadata":{"transformed":"1"},"data":[{"email":"user@example.com","operator":"blacklist","matches":["example"]},{"email":"user@example.com","matches":["example"],"operator":"deleteall"}],"status":"1","messages":null,"warnings":null},"summary":"The function succeeded."},"function-fail":{"summary":"The function failed.","value":{"result":{"data":[{"matches":["example"],"email":null,"reason":"(XID 2ymu8k) The system failed to locate the requested message:  example.msg","failed":"1"}],"errors":null,"status":"1","metadata":{"transformed":"1"},"messages":null,"warnings":["One or more of the operations failed."]},"apiversion":"3","module":"BoxTrapper"}}},"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"process_messages"},"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed. Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"type":"array","items":{"type":"object","properties":{"matches":{"type":"array","description":"An array of email messages that the system processed.","items":{"type":"string"}},"operator":{"type":"string","enum":["deliver","deliverall","delete","deleteall","blacklist","whitelist","ignore"],"example":"delete","description":"The operation that the system performed.\n* `deliver` - Delivered a specific message.\n* `deliverall` - Delivered all messages from a sender.\n* `delete` - Deleted a message.\n* `deleteall` - Deleted all messages from a sender.\n* `blacklist` - Blacklisted the sender of an email message.\n* `whitelist` - Whitelisted the sender of an email message.\n* `ignore` - Ignored email messages from a sender.\n\n**Note:**\n\nThe function only returns this value if it successfully processes the message."},"reason":{"description":"A message about the failure or the warning.\n\n**Note:**\n\nThe function only returns this value if it fails to processes the message or experiences issues when it processes the message.","type":"string"},"email":{"type":"string","nullable":"true","description":"The email address for which the system\nprocessed an email message.","format":"email"},"failed":{"type":"integer","description":"Whether the system failed to process the message.\n\n* `1` - The function failed to process the message. This is the only\npossible value.\n\n**Note:**\n\nThe function only returns this value if it fails to process the message.","example":"1","enum":["1"]}}},"description":"An array of objects containing processed email message information."},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 82","parameters":[{"in":"query","name":"email","schema":{"example":"user@example.com","format":"email","type":"string"},"description":"The account's email address.\n\n**Warning:**\n\n* The `email` parameter is required when this function is called **outside** of Webmail.\n* If you call this function in Webmail, the `email` parameter is **not** required, and\nthe system overrides this parameter with the current authenticated user's email address."},{"examples":{"single":{"value":"example.msg","summary":"Process a single email message."},"multiple":{"summary":"Process multiple email messages.","value":"email=example.msg email=example1.msg email=example2.msg"}},"description":"The filename of the email message to process. To process multiple email messages, pass this parameter multiple times.","schema":{"type":"string","example":"example.msg"},"in":"query","name":"queuefile","required":"true"},{"description":"The action to perform on the email message file. To perform multiple actions on the specified email messages, pass this parameter multiple times.\n\n* `deliver` — Deliver a specific message.\n* `deliverall` — Deliver all messages from a sender.\n* `delete` — Delete a message.\n* `deleteall` — Delete all messages from a sender.\n* `blacklist` — Blacklist the sender of an email message.\n* `whitelist` — Whitelist the sender of an email message.\n* `ignore` — Ignore email messages from a sender.\n\n**Note:**\n\nThe function performs the actions on the email messages files in the order that you pass each action.","examples":{"multiple":{"summary":"Perform multiple actions.","value":"action=blacklist action=deleteall"},"single":{"value":"blacklist","summary":"Perform a single action."}},"schema":{"example":"blacklist","enum":["deliver","deliverall","delete","deleteall","blacklist","whitelist","ignore"],"type":"string"},"name":"action","in":"query","required":"true"}],"description":"This function performs a specified action on messages in the BoxTrapper queue.\n\n**Important:**\n\nWhen you disable the [*Receive Mail*](https://go.cpanel.net/serverroles#roles) role, the system **disables** this function.","operationId":"process_messages"}}},"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}]},"get_configuration":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/get_configuration":{"get":{"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"properties":{"spam_score":{"example":"2.5","description":"The account's [Apache SpamAssassin](https://go.cpanel.net/cpaneldocsSpamFilters) threshold score.","type":"number"},"from_name":{"type":"string","example":"User","description":"The name of the person who owns the email account."},"whitelist_by_association":{"example":"1","enum":["0","1"],"description":"Whether the system whitelisted the email addresses in a message's `To` and `From` sections, including carbon-copied (CC) recipients.","type":"integer"},"enable_auto_whitelist":{"type":"integer","description":"Whether whitelisting is enabled.\n* 1 - Enabled.\n* 0 - Disabled.","enum":["0","1"],"example":"1"},"from_addresses":{"description":"The email addresses that send emails from the account. A comma-separated list of email addresses.","example":"user@example.com,user2@example.com","type":"string"},"queue_days":{"example":"14","description":"The number of days that the system retains log files and queued messages.","minimum":"0","type":"integer"}},"type":"object"}}},"module":{"example":"BoxTrapper","description":"The name of the module called.","type":"string"},"func":{"type":"string","example":"get_configuration","description":"The name of the method called."}}}}}}},"operationId":"get_configuration","description":"This function retrieves an account's BoxTrapper configuration.\n\n**Important:**\n\n  When you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system disables this function.","parameters":[{"in":"query","name":"email","required":"true","description":"The account's email address.\n\n**Warning:**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.","schema":{"example":"user@example.com","format":"email","type":"string"}}],"x-cpanel-api-version":"UAPI","summary":"Return email account's BoxTrapper configuration","tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_configuration \\\n  email='user@example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_configuration?email=user%40example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_configuration.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_configuration.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/BoxTrapper/,\n    q/get_configuration/,\n    {\n        'email' => 'user@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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_configuration.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_configuration.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    'BoxTrapper',\n    'get_configuration',\n    array (\n        'email' => 'user@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}"}]}}}},"get_message":{"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/BoxTrapper/get_message":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_message \\\n  email='user@example.com' \\\n  queuefile='example.msg'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_message?email=user%40example.com&queuefile=example.msg"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_message.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_message.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/BoxTrapper/,\n    q/get_message/,\n    {\n        'email' => 'user@example.com',\n        'queuefile' => 'example.msg',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_message.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_message.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    'BoxTrapper',\n    'get_message',\n    array (\n        'email' => 'user@example.com',\n        'queuefile' => 'example.msg',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Return message's top 200 lines in BoxTrapper queue","x-cpanel-api-version":"UAPI","parameters":[{"schema":{"anyOf":[{"type":"string","example":"user@example.com","format":"email"},{"type":"string","format":"username","example":"exampleuser"}]},"description":"The account’s name, either an email address or the cPanel user’s username.\n\n**Important:**\n\n If you call this function in Webmail, the system ignores this parameter.","example":"user@example.com","required":"true","in":"query","name":"email"},{"description":"The message's filename.","schema":{"example":"example.msg","type":"string"},"name":"queuefile","in":"query","required":"true"}],"operationId":"get_message","description":"This function returns the first 200 lines of an email in the BoxTrapper queue.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"BoxTrapper","description":"The name of the module called."},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"data":{"properties":{"contents":{},"content":{"example":"From user@example.com Tue May 07 08:30:36 2019\nReceived: from user by example.com with local (Exim 4.92) (envelope-from <root@yourserver.net>)\n    id 1hO0B1-0003Ev-Md for user2@example.com; Tue, 07 May 2019 08:30:36 -0500\nFrom: user3@example.com\nSubject: Message\nMessage-Id: <E1hO0B1-0003Ev-Md@yourserver.net>\nDate: Tue, 07 May 2019 08:30:35 -0500\n\nThis is an email message","description":"The email message's contents. Up to the first 200 lines of an email message.","type":"string"},"queuefile":{"example":"example.msg","description":"The message's filename.","type":"string"}},"type":"object"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"}},"type":"object"},"func":{"description":"The name of the method called.","example":"get_message","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 82"}}},"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}]},"delete_messages":{"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/delete_messages":{"get":{"operationId":"delete_messages","description":"This function deletes messages in the BoxTrapper queue.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system disables this function.","parameters":[{"schema":{"type":"string","format":"email","example":"user@example.com"},"description":"The account's email address.\n\n**Warning:**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.","required":"true","in":"query","name":"email"},{"examples":{"multiple":{"summary":"Delete multiple filenames.","value":"queuefile=file1.msg&queuefile=file2.msg"},"single":{"summary":"Delete a single filename.","value":"file1.msg"}},"description":"The filename of the email message who's sender to delete.\n\n  **Warning:**\n\n To delete multiple email message senders, duplicate the parameter name.","schema":{"type":"string","example":"example.msg"},"in":"query","name":"queuefile","required":"true"},{"name":"all_like","in":"query","required":"false","description":"Whether to delete all messages that resemble the `queuefile` parameter's value.\n\n* `1` - Delete all messages resembling the `queuefile` parameter.\n* `0` - Do **not** delete all messages resembling the `queuefile` parameter.","schema":{"default":"0","enum":["1","0"],"example":"1","type":"integer"}}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"delete_messages"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"items":{"properties":{"warning":{"type":"integer","description":"Whether the system experienced issues when it deleted the message.\n\n**Note:**\n\nThe function only returns this value if it experiences issues when it deletes the message.","example":"1","enum":["1"]},"matches":{"description":"An array of messages that the system deleted.","items":{"type":"string","example":"example.msg"},"type":"array"},"operator":{"type":"string","enum":["delete"],"example":"delete","description":"The operation that the system performed."},"email":{"example":"user@example.com","format":"email","description":"The deleted email message's sender.","type":"string"},"reason":{"type":"string","description":"A message about the failure or the warning.\n\n**Note:**\n\nThe function only returns this value if it doesn't delete the message or experiences issues when it deletes the message.","example":"(XID d9myfd) The system failed to locate the requested message:"},"failed":{"example":"1","enum":["1"],"description":"Whether the system failed to delete the messages.\n\n**Note:**\n\nThe function only returns this value if it doesn't delete the message.","type":"integer"}},"type":"object"},"description":"An array of objects that contain information about the messages that matched the requested pattern.","type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}},"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"}}}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  delete_messages \\\n  email='user@example.com' \\\n  queuefile='file1.msg'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/delete_messages?email=user%40example.com&queuefile=file1.msg","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_delete_messages.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_delete_messages.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/BoxTrapper/,\n    q/delete_messages/,\n    {\n        'email' => 'user@example.com',\n        'queuefile' => 'file1.msg',\n    }\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_delete_messages.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_delete_messages.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    'BoxTrapper',\n    'delete_messages',\n    array (\n        'email' => 'user@example.com',\n        'queuefile' => 'file1.msg',\n    )\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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Delete messages in the BoxTrapper queue","x-cpanel-api-version":"UAPI"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"set_allowlist":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.93.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"name":"Email","tags":["Spam Prevention (BoxTrapper)"]}],"paths":{"/BoxTrapper/set_allowlist":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update account BoxTrapper allowlist","tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty --user=username BoxTrapper set_allowlist email='user@example.com' rules-1='allowlisted-email\\@domain\\.com' rules-2='from allowlisted-email2\\@domain\\.com' rules-3='to domain2\\.com'","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_allowlist?email=user%40example.com&rules=allowlisted-email%5c%40domain%5c.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_allowlist.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_allowlist.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/BoxTrapper/,\n    q/set_allowlist/,\n    {\n        'email' => 'user@example.com',\n        'rules' => 'allowlisted-email\\@domain\\.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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_allowlist.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_allowlist.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    'BoxTrapper',\n    'set_allowlist',\n    array (\n        'email' => 'user@example.com',\n        'rules' => 'allowlisted-email\\@domain\\.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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-available-version":"cPanel 94","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"},"result":{"properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"metadata":{"properties":{}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"type":"object","default":null,"nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"description":"The name of the method called.","example":"set_allowlist","type":"string"}}}}}}},"operationId":"BoxTrapper::set_allowlist","description":"This function sets the BoxTrapper allowlist configuration rules. BoxTrapper will deliver emails that match these rules.\n\n**Important:**\n\nWhen you disable the\n[*Receive Mail* role](https://go.cpanel.net/serverroles),\nthe system **disables** this function.","parameters":[{"name":"email","in":"query","required":"true","description":"A valid email address on the cPanel account.\n\n**Warning:**\n\nIf you call this function in Webmail, the system overrides this parameter.\nThis parameter defaults to the current email address.","schema":{"type":"string","format":"email","example":"user@example.com"}},{"schema":{"items":{"type":"string"},"type":"array"},"description":"An array of allowlist rules.\n\n**Note:**\n\nYou can set multiple allowlist rules, duplicate or increment the parameter name. For example,\n`rules-1`, `rules-2`, and `rules-3`.","examples":{"multiple-alternative":{"value":"rules='allowlisted-email\\@domain\\.com' rules='from allowlisted-email2\\@domain\\.com' rules='to domain2\\.com'","summary":"Set multiple rules."},"multiple":{"value":"rules-1='allowlisted-email\\@domain\\.com' rules-2='from allowlisted-email2\\@domain\\.com' rules-3='to domain2\\.com'","summary":"Set multiple rules."},"single":{"value":"allowlisted-email\\@domain\\.com","summary":"Set a single rule."}},"required":"true","in":"query","name":"rules"}]}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"get_email_template":{"x-tagGroups":[{"name":"Email","tags":["Spam Prevention (BoxTrapper)"]}],"paths":{"/BoxTrapper/get_email_template":{"get":{"parameters":[{"schema":{"type":"string","format":"email","example":"user@example.com"},"description":"A valid email address on the cPanel account.\n\n**Warning:**\n\nIf you call this function in Webmail, the system overrides this parameter.\nThis parameter defaults to the current email address.","required":"true","name":"email","in":"query"},{"schema":{"example":"verify","enum":["blacklist","returnverify","verifyreleased","verify"],"type":"string"},"description":"The message template.\n\n* `blacklist`\n* `returnverify`\n* `verifyreleased`\n* `verify`\n\n**Note:**\n\nFor more information on each template, read our\n[BoxTrapper](https://go.cpanel.net/cpaneldocsBoxTrapper) documentation.","required":"true","in":"query","name":"template"}],"description":"This function retrieves a BoxTrapper email message template.\n\n**Important:**\n\n  When you disable the\n  [*Receive Mail* role](https://go.cpanel.net/serverroles),\n  the system **disables** this function.","operationId":"get_email_template","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"string","example":"To: %email%\\nSubject: Re: %subject%\\n\\nThe user %acct% does not accept mail from your address.\\n\\nThe headers of the message sent from your address are shown below:\\n\\n%headers%\\n\",","description":"The template file's contents."},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"module":{"type":"string","description":"The name of the module called.","example":"BoxTrapper"},"func":{"example":"get_email_template","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 84","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_email_template \\\n  email='user@example.com' \\\n  template='verify'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_email_template?email=user%40example.com&template=verify"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_email_template.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_email_template.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/BoxTrapper/,\n    q/get_email_template/,\n    {\n        'email' => 'user@example.com',\n        'template' => 'verify',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_email_template.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_email_template.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    'BoxTrapper',\n    'get_email_template',\n    array (\n        'email' => 'user@example.com',\n        'template' => 'verify',\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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Return specified BoxTrapper email template","x-cpanel-api-version":"UAPI"}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"reset_email_template":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2","x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/reset_email_template":{"get":{"description":"This function restores the BoxTrapper email message templates to the system default setting.\n\n**Important:**\n\nWhen you **disable** the [Receive Mail](https://go.cpanel.net/serverroles) role, the system disables this function.","operationId":"reset_email_template","parameters":[{"description":"The account's email address.\n\n**Warning:**\n\nThe `email` parameter is required when this function is called outside of webmail.\nIf you call this function in Webmail, the `email` parameter is not required, and\nthe system overrides this parameter with the current authenticated user's email address.","schema":{"type":"string","format":"email","example":"user@example.com"},"in":"query","name":"email"},{"schema":{"type":"string","example":"verify","enum":["blacklist","verify","verifyreleased","returnverify"]},"description":"The message template. Possible values:\n* `blacklist` - BoxTrapper responds with this message when a blacklisted address sends an email.\n* `verify` - BoxTrapper responds with this message when an address that does not exist on the whitelist or blacklist sends an email. This message requests a response to confirm that the sender is legitimate.\n* `verifyreleased` - BoxTrapper responds with this message when a person responds to the verify message with an email or a click on the verification link.\n* `returnverify` - BoxTrapper responds with this message when the verification process fails.","required":"true","name":"template","in":"query"}],"x-cpanel-available-version":"cPanel 84","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"reset_email_template"},"result":{"properties":{"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"default":null,"nullable":"true","type":"object"},"metadata":{"properties":{}},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null,"type":"array"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"}}}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  reset_email_template \\\n  template='verify'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/reset_email_template?template=verify"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_reset_email_template.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_reset_email_template.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/BoxTrapper/,\n    q/reset_email_template/,\n    {\n        'template' => 'verify',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_reset_email_template.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_reset_email_template.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    'BoxTrapper',\n    'reset_email_template',\n    array (\n        'template' => 'verify',\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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Restore default BoxTrapper email message template","x-cpanel-api-version":"UAPI"}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}]},"save_email_template":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"openapi":"3.0.2","x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/save_email_template":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"BoxTrapper","description":"The name of the module called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"data":{"default":null,"nullable":"true","type":"object"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"save_email_template","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 84","parameters":[{"required":"true","name":"email","in":"query","schema":{"type":"string","format":"email","example":"user@example.com"},"description":"The account's email address.\n\n**Warning:**\n\nIf you call this function in Webmail, the system overrides this parameter.\n\n**Note:**\n\nThis parameter defaults to the current email address."},{"in":"query","name":"template","required":"true","description":"The message template.\n\n* `blacklist`\n* `returnverify`\n* `verifyreleased`\n* `verify`\n\n**Important:**\n\nIf you use the `verify` template, you **must** include `Subject: verify#%msgid%` in this parameter's value.\n\n**Note:**\n\nFor more information about each template, read our [BoxTrapper documentation](https://go.cpanel.net/cpaneldocsBoxTrapper).","schema":{"type":"string","example":"blacklist","enum":["blacklist","returnverify","verifyreleased","verify"]}},{"name":"contents","in":"query","required":"true","description":"The template file's contents.\n\nYou can use [variables](https://go.cpanel.net/cpaneldocsBoxTrapper) in the template\nto include details about the original message.\n\n**Important:**\n\n* You **must** include `To: %email%` in this parameter's value.\n* If you use the `verify` template, you **must** include `Subject: verify#%msgid%` in this parameter's value.\n* This value cannot exceed four kilobytes (KB).\n* You **must** URI-encode this parameter's value when using the CLI.","schema":{"example":"To: %email%\nSubject: Re: %subject%\n\nThe user %acct% does not accept mail from your address.\n\nThe headers of the message sent from your address are shown below:\n\n%headers%","type":"string"}}],"description":"This function saves the contents of a BoxTrapper message template.\n\n**Important:**\n\nWhen you disable the [_Receive Mail_ role](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","operationId":"save_email_template","summary":"Save BoxTrapper message template contents","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  save_email_template \\\n  email='user@example.com' \\\n  template='blacklist' \\\n  contents='To: %25email%25\nSubject: Re: %25subject%25\n\nThe user %25acct%25 does not accept mail from your address.\n\nThe headers of the message sent from your address are shown below:\n\n%25headers%25'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/save_email_template?email=user%40example.com&template=blacklist&contents=To%3a%20%25email%25%0aSubject%3a%20Re%3a%20%25subject%25%0a%0aThe%20user%20%25acct%25%20does%20not%20accept%20mail%20from%20your%20address.%0a%0aThe%20headers%20of%20the%20message%20sent%20from%20your%20address%20are%20shown%20below%3a%0a%0a%25headers%25","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_save_email_template.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_save_email_template.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/BoxTrapper/,\n    q/save_email_template/,\n    {\n        'email' => 'user@example.com',\n        'template' => 'blacklist',\n        'contents' => 'To: %email%\nSubject: Re: %subject%\n\nThe user %acct% does not accept mail from your address.\n\nThe headers of the message sent from your address are shown below:\n\n%headers%',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_save_email_template.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_save_email_template.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    'BoxTrapper',\n    'save_email_template',\n    array (\n        'email' => 'user@example.com',\n        'template' => 'blacklist',\n        'contents' => 'To: %email%\nSubject: Re: %subject%\n\nThe user %acct% does not accept mail from your address.\n\nThe headers of the message sent from your address are shown below:\n\n%headers%',\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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"]}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"deliver_messages":{"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/deliver_messages":{"get":{"description":"This function delivers messages in the BoxTrapper queue.\n\n**Important:**\n\nWhen you disable the\n[*Receive Mail* role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles),\nthe system **disables** this function.","operationId":"deliver_messages","parameters":[{"description":"The sender's cPanel account email address for which to deliver email messages.\n\n**Warning:**\n\nIf you call this function in Webmail, the system ignores this parameter\nand defaults to the currently-authenticated email address.","schema":{"format":"email","example":"user@example.com","type":"string"},"in":"query","name":"email","required":"true"},{"schema":{"type":"string"},"examples":{"single":{"value":"example.msg","summary":"Deliver a single email message."},"multiple":{"summary":"Deliver multiple email messages.","value":"queuefile=example.msg&queuefile=example1.msg&queuefile=example2.msg"}},"description":"The filename of the email messages to deliver.\n\n**Note:**\n\nTo deliver multiple email messages, pass this parameter multiple times.","required":"true","in":"query","name":"queuefile"},{"name":"all_like","in":"query","required":"false","description":"Whether to deliver all messages that resemble the `queuefile` parameter's value.\n\n* `1` - Deliver all similar messages.\n* `0` - Don't deliver all similar messages.","schema":{"enum":["0","1"],"example":"1","default":"0","type":"integer"}}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"BoxTrapper","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"description":"The delivered email message information.","items":{"properties":{"matches":{"type":"array","description":"A list of delivered email messages.","items":{"example":"example.msg","type":"string"}},"operator":{"type":"string","description":"The action that the function performed.\n\n* `deliver`\n* `deliverall`","enum":["deliver","deliverall"],"example":"deliverall"},"warning":{"type":"integer","description":"Whether the system experienced issues when it delivered the message.\n\n**Note:**\n\n * The function only returns this value if it experiences issues when it delivers the message.\n * `1` is the only possible value.","enum":["1"],"example":"1"},"reason":{"example":"This is a failure message.","description":"A message about the failure or the warning.\n\n**Note:**\n\nThe function only returns this value if it doesn't delete the message or experiences\nissues when it deletes the message.","type":"string"},"email":{"example":"user@example.com","description":"The delivered email message's sender.","format":"email","type":"string"},"failed":{"type":"integer","description":"Whether the system could not deliver the message.\n\n**Note:**\n\n * The function only returns this value if it doesn't deliver the message.\n * `1` is the only possible value.","example":"1","enum":["1"]}},"type":"object"},"type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"func":{"example":"deliver_messages","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  deliver_messages \\\n  email='user@example.com' \\\n  queuefile='example.msg'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/deliver_messages?email=user%40example.com&queuefile=example.msg"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_deliver_messages.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_deliver_messages.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/BoxTrapper/,\n    q/deliver_messages/,\n    {\n        'email' => 'user@example.com',\n        'queuefile' => 'example.msg',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_deliver_messages.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_deliver_messages.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    'BoxTrapper',\n    'deliver_messages',\n    array (\n        'email' => 'user@example.com',\n        'queuefile' => 'example.msg',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Send messages in the BoxTrapper queue"}}},"tags":[{"description":"The BoxTrapper module for UAPI.","name":"BoxTrapper"},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2"},"set_ignorelist":{"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"paths":{"/BoxTrapper/set_ignorelist":{"get":{"parameters":[{"in":"query","name":"email","required":"true","description":"A valid email address on the cPanel account.\n\n**Warning:**\n\nIf you call this function in Webmail, the system overrides this parameter.\nThis parameter defaults to the current email address.","schema":{"example":"user@example.com","format":"email","type":"string"}},{"required":"true","in":"query","name":"rules","schema":{"type":"array","items":{"type":"string"}},"description":"An array of ignorelist rules.\n\n**Note:**\n\nYou can set multiple ignore rules, duplicate or increment the parameter name. For example,\n`rules-1`, `rules-2`, and `rules-3`.","examples":{"multiple-alternative":{"value":"rules='ignored-email\\@domain\\.com' rules='from ignored-email2\\@domain\\.com' rules='to domain2\\.com'","summary":"Set multiple rules."},"multiple":{"value":"rules-1='ignored-email\\@domain\\.com' rules-2='from ignored-email2\\@domain\\.com' rules-3='to domain2\\.com'","summary":"Set multiple rules."},"single":{"value":"ignored-email\\@domain\\.com","summary":"Set a single rule."}}}],"operationId":"BoxTrapper::set_ignorelist","description":"This function sets the BoxTrapper ignorelist configuration rules. BoxTrapper will delete messages that match these rules without sending a notification to the sender.\n\n**Important:**\n\nWhen you disable the\n[*Receive Mail* role](https://go.cpanel.net/serverroles),\nthe system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"BoxTrapper"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{}},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"type":"object","default":null,"nullable":"true"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."}},"type":"object"},"func":{"description":"The name of the method called.","example":"set_ignorelist","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 94","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty --user=username BoxTrapper set_ignorelist email='user@example.com' rules-1='ignored-email\\@domain\\.com' rules-2='from ignored-email2\\@domain\\.com' rules-3='to domain2\\.com'"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_ignorelist?email=user%40example.com&rules=ignored-email%5c%40domain%5c.com","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_ignorelist.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_ignorelist.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/BoxTrapper/,\n    q/set_ignorelist/,\n    {\n        'email' => 'user@example.com',\n        'rules' => 'ignored-email\\@domain\\.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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_ignorelist.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_ignorelist.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    'BoxTrapper',\n    'set_ignorelist',\n    array (\n        'email' => 'user@example.com',\n        'rules' => 'ignored-email\\@domain\\.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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Update account BoxTrapper ignorelist","x-cpanel-api-version":"UAPI"}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.93.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"set_forwarders":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/BoxTrapper/set_forwarders":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"set_forwarders"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"default":null,"nullable":"true","type":"object"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}}},"module":{"type":"string","example":"BoxTrapper","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 86","parameters":[{"schema":{"example":"user@example.com","type":"string"},"description":"The account's email address.\n\n**Warning:**\n\nIf you call this function\nin Webmail, the system ignores this parameter and uses the currently-authenticated\nemail address.","required":"true","name":"email","in":"query"},{"example":["user1@example.com"],"description":"The email addresses to which to forward email messages.","schema":{"type":"array","items":{"format":"email","example":"user1@example.com"}},"name":"forwarder","in":"query","required":"true"}],"operationId":"set_forwarders","description":"This function adds a list of email addresses to which BoxTrapper forwards email messages.\n\n**Important:**\n\n  When you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","summary":"Add email address to BoxTrapper forwarders","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  set_forwarders \\\n  email='user@example.com' \\\n  forwarder='user1@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_forwarders?email=user%40example.com&forwarder=user1%40example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_forwarders.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_forwarders.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/BoxTrapper/,\n    q/set_forwarders/,\n    {\n        'email' => 'user@example.com',\n        'forwarder' => 'user1@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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_forwarders.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_forwarders.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    'BoxTrapper',\n    'set_forwarders',\n    array (\n        'email' => 'user@example.com',\n        'forwarder' => 'user1@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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"]}}},"x-tagGroups":[{"name":"Email","tags":["Spam Prevention (BoxTrapper)"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The BoxTrapper module for UAPI.","name":"BoxTrapper"},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}]},"set_blocklist":{"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Spam Prevention (BoxTrapper)"]}],"paths":{"/BoxTrapper/set_blocklist":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update account BoxTrapper blocklist","tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty --user=username BoxTrapper set_blocklist email='user@example.com' rules-1='blocklisted-email\\@domain\\.com' rules-2='from blocklisted-email2\\@domain\\.com' rules-3='to domain2\\.com'","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_blocklist?email=user%40example.com&rules=blocklisted-email%5c%40domain%5c.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_blocklist.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_blocklist.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/BoxTrapper/,\n    q/set_blocklist/,\n    {\n        'email' => 'user@example.com',\n        'rules' => 'blocklisted-email\\@domain\\.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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_blocklist.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_set_blocklist.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    'BoxTrapper',\n    'set_blocklist',\n    array (\n        'email' => 'user@example.com',\n        'rules' => 'blocklisted-email\\@domain\\.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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"BoxTrapper"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"metadata":{"properties":{}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"data":{"nullable":"true","default":null,"type":"object"}},"type":"object"},"func":{"type":"string","description":"The name of the method called.","example":"set_blocklist"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 94","parameters":[{"in":"query","name":"email","required":"true","description":"A valid email address on the cPanel account.\n\n**Warning:**\n\nIf you call this function in Webmail, the system overrides this parameter.\nThis parameter defaults to the current email address.","schema":{"example":"user@example.com","format":"email","type":"string"}},{"schema":{"items":{"type":"string"},"type":"array"},"description":"An array of blocklist rules.\n\n**Note:**\n\nYou can set multiple block rules, duplicate or increment the parameter name. For example,\n`rules-1`, `rules-2`, and `rules-3`.","examples":{"multiple-alternative":{"summary":"Set multiple rules.","value":"rules='blocklisted-email\\@domain\\.com' rules='from blocklisted-email2\\@domain\\.com' rules='to domain2\\.com'"},"multiple":{"summary":"Set multiple rules.","value":"rules-1='blocklisted-email\\@domain\\.com' rules-2='from blocklisted-email2\\@domain\\.com' rules-3='to domain2\\.com'"},"single":{"value":"blocklisted-email\\@domain\\.com","summary":"Set a single rule."}},"required":"true","in":"query","name":"rules"}],"description":"This function sets the BoxTrapper blocklist configuration rules. BoxTrapper will delete messages that match these rules and send a notification to the sender.\n\n**Important:**\n\nWhen you disable the\n[*Receive Mail* role](https://go.cpanel.net/serverroles),\nthe system **disables** this function.","operationId":"BoxTrapper::set_blocklist"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.93.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"}},"ignore_messages":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"openapi":"3.0.2","x-tagGroups":[{"name":"Email","tags":["Spam Prevention (BoxTrapper)"]}],"paths":{"/BoxTrapper/ignore_messages":{"get":{"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"BoxTrapper","description":"The name of the module called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"data":{"example":[{"operator":"ignore","matches":["example.msg"],"email":"user@example.com"}],"description":"An array of objects containing ignored email message information.","items":{"type":"object","properties":{"failed":{"description":"Whether the system failed to ignore the messages.\n\n* `1` - Failed to ignore the message.\n\n* `1` - Failed to ignore the message.\n\n* `1` - Failed to ignore the message.\n\n* `1` - Failed to ignore the message.\n\n* `1` - Failed to ignore the message.\n\n**Note:**\n\n The function only returns this value if it experiences issues when it ignores the message.","example":"1","enum":["1"],"type":"integer"},"warning":{"type":"integer","enum":["1"],"example":"1","description":"Whether the system experienced issues when it ignored the message.\n\n* `1` — The system encountered a problem.\n\n**Note:**\n\n The function only returns this value if it experiences issues when it ignores the message."},"operator":{"enum":["ignore"],"example":"ignore","description":"The operation that the system performed.\n\n* `ignore` — The system ignored this email message.","type":"string"},"matches":{"items":{"example":"example.msg","type":"string"},"description":"An array containing ignored message files.","type":"array"},"email":{"type":"string","example":"user@example.com","description":"The ignored email message's sender.","format":"email"},"reason":{"example":"This is a failure message.","description":"A message that describes the failure or the warning.\n\n**Note:**\n\n The function only returns this value if it doesn't ignore the message or experiences issues when it ignores the message. ","type":"string"}}},"type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"func":{"type":"string","description":"The name of the method called.","example":"ignore_messages"}}}}}}},"operationId":"ignore_messages","description":"This function marks email message senders for Exim to ignore.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","parameters":[{"required":"true","in":"query","name":"email","schema":{"format":"email","example":"user@example.com","type":"string"},"description":"The cPanel email account from which to ignore messages.\n\n**Warning:** \n\nIf you call this function in Webmail, the system ignores this parameter and defaults\nto the currently-authenticated email address."},{"in":"query","name":"queuefile","required":"true","description":"The filename of the email message to ignore.\n\n**Note:**\n\n To ignore multiple email messages, duplicate this parameter.","examples":{"single":{"summary":"Ignore a single email message.","value":"example.msg"},"multiple":{"summary":"Ignore multiple email messages.","value":"queuefile-1=example1.msg queuefile-2=example2.msg queuefile-3=example3.msg"}},"schema":{"type":"string"}}],"summary":"Add email account to Exim ignore list","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  ignore_messages \\\n  email='user@example.com' \\\n  queuefile='example.msg'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/ignore_messages?email=user%40example.com&queuefile=example.msg"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_ignore_messages.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_ignore_messages.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/BoxTrapper/,\n    q/ignore_messages/,\n    {\n        'email' => 'user@example.com',\n        'queuefile' => 'example.msg',\n    }\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_ignore_messages.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_ignore_messages.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    'BoxTrapper',\n    'ignore_messages',\n    array (\n        'email' => 'user@example.com',\n        'queuefile' => 'example.msg',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"]}}},"tags":[{"name":"BoxTrapper","description":"The BoxTrapper module for UAPI."},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}]},"whitelist_messages":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"description":"The BoxTrapper module for UAPI.","name":"BoxTrapper"},{"description":"Email / Spam Prevention (BoxTrapper)","name":"Spam Prevention (BoxTrapper)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"Email","tags":["Spam Prevention (BoxTrapper)"]}],"paths":{"/BoxTrapper/whitelist_messages":{"get":{"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  whitelist_messages \\\n  queuefile='example.msg'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/whitelist_messages?queuefile=example.msg"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_whitelist_messages.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_whitelist_messages.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/BoxTrapper/,\n    q/whitelist_messages/,\n    {\n        'queuefile' => 'example.msg',\n    }\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_whitelist_messages.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_whitelist_messages.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    'BoxTrapper',\n    'whitelist_messages',\n    array (\n        'queuefile' => 'example.msg',\n    )\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","summary":"Add email address to BoxTrapper allowed senders","description":"This function whitelists email messages.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.\n\n**Note:**\n\nTo retrieve email messages in the BoxTrapper queue from senders that you did not previously whitelist, use the UAPI `BoxTrapper::deliver_messages` function.","operationId":"whitelist_messages","parameters":[{"schema":{"type":"string","format":"email","example":"user@example.com"},"description":"The cPanel account email address for which to whitelist messages.\n\n**Warning**\n\nIf you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.","required":"false","name":"email","in":"query"},{"in":"query","name":"queuefile","required":"true","examples":{"multiple":{"summary":"Whitelist multiple messages.","value":"queuefile=ex1.msg&queuefile=ex2.msg&queuefile=ex3.msg"},"single":{"summary":"Whitelist a single message.","value":"example.msg"}},"description":"The filename of the email message to whitelist.\n\n**Note:**\n\nTo get a list of filenames in an account's BoxTrapper queue, use the UAPI `BoxTrapper::list_queued_messages` function.\n\n**Note:**\n\nTo whitelist multiple email messages, duplicate this parameter.","schema":{"type":"string","example":"example.msg"}}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"whitelist_messages"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"type":"array","example":[{"operator":"whitelist","matches":["example.msg"],"email":"user@example.com"}],"items":{"properties":{"email":{"type":"string","example":"user@example.com","format":"email","description":"A whitelisted email address."},"reason":{"type":"string","example":"The cPanel user, \"user\" does not own the requested account \"user@example.com.\"","description":"The reason the function skipped the message during whitelisting. The `reason` property is returned only if the function failed to whitelist the message."},"warning":{"default":"1","description":"Whether the system experienced issues when it whitelisted the message.\n\n* `1` — There was an issue whitelisting the message. This is the only possible value.\n\n**Note:**\n\nThe function only returns this property if it failed to whitelist the message.","enum":["1"],"example":"1","type":"integer"},"operator":{"type":"string","example":"whitelist","enum":["whitelist"],"description":"The action that the system performed.","default":"whitelist"},"matches":{"description":"An array of message files that the system whitelisted.\n\n**Note:**\n\nThe function **only** returns this value if it whitelists the message.","items":{"example":"example.msg","type":"string"},"type":"array"},"failed":{"type":"string","description":"The system failed to whitelist the message.\n\n* `1` — The function failed to whitelist the message. This is the only possible value.\n\n**Note:**\n\nThe function only returns this property if it failed to whitelist the message.","default":"1","example":"1","enum":["1"]}},"type":"object"},"description":"An array of one or more objects, depending on how many queuefiles were passed as parameters. Each object contains information about the whitelisted email message."},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null,"type":"array"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}},"module":{"example":"BoxTrapper","description":"The name of the module called.","type":"string"}}}}}}}}}}},"get_status":{"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The BoxTrapper module for UAPI.","name":"BoxTrapper"},{"name":"Spam Prevention (BoxTrapper)","description":"Email / Spam Prevention (BoxTrapper)"}],"paths":{"/BoxTrapper/get_status":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BoxTrapper \\\n  get_status \\\n  email='user@example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_status?email=user%40example.com","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_status.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_status.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/BoxTrapper/,\n    q/get_status/,\n    {\n        'email' => 'user@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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_status.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BoxTrapper_get_status.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    'BoxTrapper',\n    'get_status',\n    array (\n        'email' => 'user@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}"}],"tags":["BoxTrapper","Spam Prevention (BoxTrapper)"],"summary":"Return whether email account uses BoxTrapper","x-cpanel-api-version":"UAPI","parameters":[{"required":"true","name":"email","in":"query","schema":{"type":"string","format":"email","example":"user@example.com"},"description":"The account's email address.\n\n**Important:**\n\nIf you call this function in Webmail, the system ignores this parameter."}],"operationId":"get_status","description":"This function checks whether BoxTrapper is enabled for an email account.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"metadata":{"properties":{}},"data":{"enum":["0","1"],"example":"0","description":"Whether BoxTrapper is enabled for the email account.\n* `1` — Enabled.\n* `0` — Disabled.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"}},"type":"object"},"module":{"example":"BoxTrapper","description":"The name of the module called.","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"get_status"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 82"}}},"x-tagGroups":[{"tags":["Spam Prevention (BoxTrapper)"],"name":"Email"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]}},"ContactInformation":{"set_pushbullet_access_token":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.129.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"name":"Contact Information","tags":["Contact Information"]}],"paths":{"/ContactInformation/set_pushbullet_access_token":{"get":{"description":"This function updates the cPanel account's Pushbullet™ access token.","operationId":"contactinformation-set_pushbullet_access_token","parameters":[{"schema":{"example":"a1b2c3d4e5f6g7h8i9j0","type":"string"},"explode":"true","description":"The account’s new Pushbullet access token.","required":"true","name":"pushbullet_access_token","in":"query"}],"x-cpanel-available-version":"130","responses":{"200":{"description":"Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"ContactInformation"},"func":{"example":"set_pushbullet_access_token","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ContactInformation \\\n  set_pushbullet_access_token \\\n  pushbullet_access_token='a1b2c3d4e5f6g7h8i9j0'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/ContactInformation/set_pushbullet_access_token?pushbullet_access_token=a1b2c3d4e5f6g7h8i9j0"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ContactInformation_set_pushbullet_access_token.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ContactInformation_set_pushbullet_access_token.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/ContactInformation/,\n    q/set_pushbullet_access_token/,\n    {\n        'pushbullet_access_token' => 'a1b2c3d4e5f6g7h8i9j0',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ContactInformation_set_pushbullet_access_token.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ContactInformation_set_pushbullet_access_token.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    'ContactInformation',\n    'set_pushbullet_access_token',\n    array (\n        'pushbullet_access_token' => 'a1b2c3d4e5f6g7h8i9j0',\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}"}],"tags":["ContactInformation","Contact Information"],"summary":"Update Pushbullet access token","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The ContactInformation module for UAPI.","name":"ContactInformation"},{"description":"Contact Information","name":"Contact Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel."}}}]},"get_notification_preferences":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"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/","version":"11.129.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"name":"ContactInformation","description":"The ContactInformation module for UAPI."},{"description":"Contact Information","name":"Contact Information"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Contact Information","tags":["Contact Information"]}],"paths":{"/ContactInformation/get_notification_preferences":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"ContactInformation","description":"The name of the module called."},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"data":{"items":{"properties":{"descp":{"type":"string","example":"Someone logs in to my account.","description":"A description of the notification setting."},"name":{"description":"The notification preference key name.","example":"notify_account_login","type":"string"},"additionalProperties":{"type":"string"},"enabled":{"example":"1","enum":["0","1"],"description":"- 1 - Notification is enabled\n- 0 - Notification is disabled","type":"integer"}},"type":"object"},"description":"An array of objects describing the cPanel or Webmail account's notification preferences.","type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"},"func":{"example":"get_notification_preferences","description":"The name of the method called.","type":"string"}}}}},"description":"Request was successful."}},"parameters":[],"operationId":"contactinformation-get_notification_preferences","description":"Use this function to get a cPanel or Webmail account's notification preferences.","summary":"Return the account's notification preferences.","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ContactInformation \\\n  get_notification_preferences\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/ContactInformation/get_notification_preferences"}],"tags":["ContactInformation","Contact Information","notifications"]}}}},"set_email_addresses":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.101.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"tags":[{"name":"ContactInformation","description":"The ContactInformation module for UAPI."},{"description":"Contact Information","name":"Contact Information"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Contact Information","tags":["Contact Information"]}],"paths":{"/ContactInformation/set_email_addresses":{"get":{"x-cpanel-api-version":"UAPI","summary":"Set contact email address(es)","tags":["ContactInformation","Contact Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ContactInformation \\\n  set_email_addresses \\\n  address='foo@example.com' address='bar@example.com' \\\n  old_address='old1@example.com' \\\n  password='q1df%D9<z0ShqdxRP%^'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ContactInformation/set_email_addresses?address=foo%40example.com&address=bar%40example.com&old_address=old1%40example.com&password=q1df%25D9%3cz0ShqdxRP%25%5e","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ContactInformation_set_email_addresses.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ContactInformation_set_email_addresses.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/ContactInformation/,\n    q/set_email_addresses/,\n    {\n        'address' => 'foo@example.com'&address='bar@example.com',\n        'old_address' => 'old1@example.com',\n        'password' => 'q1df%D9<z0ShqdxRP%^',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ContactInformation_set_email_addresses.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ContactInformation_set_email_addresses.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    'ContactInformation',\n    'set_email_addresses',\n    array (\n        'address' => 'foo@example.com'&address='bar@example.com',\n        'old_address' => 'old1@example.com',\n        'password' => 'q1df%D9<z0ShqdxRP%^',\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}"}],"responses":{"200":{"description":"Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"properties":{"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"ContactInformation","type":"string"},"func":{"type":"string","example":"set_email_addresses","description":"The name of the method called."}},"type":"object"}}}}},"x-cpanel-available-version":"102","parameters":[{"required":"true","name":"address","in":"query","explode":"true","schema":{"type":"array","items":{"format":"email","type":"string"}},"example":["foo@example.com","bar@example.com"],"description":"The account’s new contact email addresses."},{"required":"true","name":"old_address","in":"query","explode":"true","schema":{"type":"array","items":{"format":"email","type":"string"}},"example":["old1@example.com"],"description":"The account’s existing contact email addresses.\n\nIf this list does not match the account’s current current email address(es),\nthen the request will fail. This control is here to prevent\nrace conditions."},{"description":"The account’s password.","schema":{"example":"q1df%D9<z0ShqdxRP%^","type":"string"},"name":"password","in":"query","required":"true"}],"operationId":"contactinformation-set_email_addresses","description":"Use this function to set an account's contact email address(es).\n\nTo unset all contact email addresses, call `unset_email_addresses`."}}}},"get_pushbullet_access_token":{"x-tagGroups":[{"name":"Contact Information","tags":["Contact Information"]}],"paths":{"/ContactInformation/get_pushbullet_access_token":{"get":{"tags":["ContactInformation","Contact Information"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ContactInformation \\\n  get_pushbullet_access_token\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/ContactInformation/get_pushbullet_access_token"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ContactInformation_get_pushbullet_access_token.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ContactInformation_get_pushbullet_access_token.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/ContactInformation/,\n    q/get_pushbullet_access_token/,\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ContactInformation_get_pushbullet_access_token.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ContactInformation_get_pushbullet_access_token.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    'ContactInformation',\n    'get_pushbullet_access_token',\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","summary":"Return Pushbullet access token","description":"This function retrieves the cPanel account's Pushbullet™ access token.","operationId":"contactinformation-get_pushbullet_access_token","parameters":[],"x-cpanel-available-version":"130","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"type":"string","description":"The cPanel account's Pushbullet access token.","example":"a1b2c3d4e5f6g7h8i9j0"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API call.","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"ContactInformation","description":"The name of the module called.","type":"string"},"func":{"type":"string","example":"get_pushbullet_access_token","description":"The name of the method called."}},"type":"object"}}},"description":"Request was successful."}}}}},"tags":[{"description":"The ContactInformation module for UAPI.","name":"ContactInformation"},{"name":"Contact Information","description":"Contact Information"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel.","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"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/","version":"11.129.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2"},"set_notification_preferences":{"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.129.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/ContactInformation/set_notification_preferences":{"post":{"requestBody":{"content":{"application/json":{"schema":{"properties":{"preferences":{"additionalProperties":{"type":"string"},"type":"object"}}},"examples":{"two":{"summary":"An example showing how to set two account notification preferences.","value":{"preferences":{"notify_account_authn_link":"0","notify_account_login":"1"}}}}}}},"tags":["ContactInformation","Contact Information","notifications"],"x-codeSamples":[{"source":"echo '{\"preferences\": { \"notify_account_authn_link\": 1 }}' | \\\n  uapi --output=jsonpretty \\\n  --user=muser \\\n  --input=json \\\n  ContactInformation \\\n  set_notification_preferences\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/ContactInformation/set_notification_preferences"}],"x-cpanel-api-version":"UAPI","summary":"Set the account's notification preferences.","parameters":[],"description":"Use this function to set the logged in cPanel or Webmail account's notification preferences.\n\n**Note:**\n\nTo set a cPanel account's notification email address, call `set_email_addresses`. To return the list of account notification\npreferences you can set with `set_notification_preferences`, call `get_notification_preferences`.","operationId":"contactinformation-set_notification_preferences","responses":{"200":{"description":"Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"set_notification_preferences","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","nullable":"true"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"type":"array","description":"An array of cPanel and Webmail account notification preferences, including the newly-set preferences.","items":{"type":"object","properties":{"enabled":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Notification is enabled\n- 0 - Notification is disabled"},"descp":{"example":"Someone logs in to my account.","description":"A description of the notification setting.","type":"string"},"name":{"type":"string","example":"notify_account_login","description":"The notification preference key name."},"additionalProperties":{"type":"string"}}}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"ContactInformation","description":"The name of the module called."}},"type":"object"}}}}}}}},"x-tagGroups":[{"tags":["Contact Information"],"name":"Contact Information"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The ContactInformation module for UAPI.","name":"ContactInformation"},{"name":"Contact Information","description":"Contact Information"}]},"unset_email_addresses":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.101.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/ContactInformation/unset_email_addresses":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ContactInformation \\\n  unset_email_addresses \\\n  old_address='old1@example.com' \\\n  password='q1df%D9<z0ShqdxRP%^'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/ContactInformation/unset_email_addresses?old_address=old1%40example.com&password=q1df%25D9%3cz0ShqdxRP%25%5e"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ContactInformation_unset_email_addresses.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ContactInformation_unset_email_addresses.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/ContactInformation/,\n    q/unset_email_addresses/,\n    {\n        'old_address' => 'old1@example.com',\n        'password' => 'q1df%D9<z0ShqdxRP%^',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ContactInformation_unset_email_addresses.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ContactInformation_unset_email_addresses.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    'ContactInformation',\n    'unset_email_addresses',\n    array (\n        'old_address' => 'old1@example.com',\n        'password' => 'q1df%D9<z0ShqdxRP%^',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["ContactInformation","Contact Information"],"summary":"Unset contact email addresses","x-cpanel-api-version":"UAPI","description":"Use this function to unset all contact email address for an account.\n\nTo set contact email address(es), call `set_email_addresses`.","operationId":"contactinformation-unset_email_addresses","parameters":[{"example":["old1@example.com"],"description":"The account’s existing contact email addresses.\n\nIf this list does not match the account’s current current email address(es),\nthen the request will fail. This control is here to prevent\nrace conditions.","explode":"true","schema":{"type":"array","items":{"type":"string","format":"email"}},"name":"old_address","in":"query","required":"true"},{"in":"query","name":"password","required":"true","description":"The account’s password.","schema":{"type":"string","example":"q1df%D9<z0ShqdxRP%^"}}],"x-cpanel-available-version":"102","responses":{"200":{"description":"Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"create","description":"The name of the method called."},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"},"module":{"description":"The name of the module called.","example":"DynamicDNS","type":"string"}}}}}}}}}},"x-tagGroups":[{"tags":["Contact Information"],"name":"Contact Information"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"ContactInformation","description":"The ContactInformation module for UAPI."},{"name":"Contact Information","description":"Contact Information"}]}},"NginxCaching":{"clear_cache":{"tags":[{"description":"The NginxCaching module for UAPI.","name":"NginxCaching"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["NginxCaching"],"name":"Web Server Management"}],"paths":{"/NginxCaching/clear_cache":{"get":{"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  NginxCaching \\\n  clear_cache\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/NginxCaching/clear_cache"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file NginxCaching_clear_cache.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/NginxCaching_clear_cache.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/NginxCaching/,\n    q/clear_cache/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file NginxCaching_clear_cache.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/NginxCaching_clear_cache.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    'NginxCaching',\n    'clear_cache'\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}"}],"tags":["NginxCaching"],"description":"This function clears the user's NGINX cache.\n\n**Note:**\n\n  - You can **only** use this function if you installed the `ea-nginx` package.","operationId":"clear_cache","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"properties":{}},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"NginxCaching","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"clear_cache"}}}}}}},"summary":"Delete NGINX cache contents.","x-cpanel-api-version":"UAPI","x-cpanel-available-version":"cPanel 100"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}}},"enable_cache":{"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/NginxCaching/enable_cache":{"get":{"description":"This function enables the user's NGINX cache.\n\n**Note:**\n\n  - You can **only** use this function if you installed the `ea-nginx` package.","operationId":"enable_cache","tags":["NginxCaching"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  NginxCaching \\\n  enable_cache\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/NginxCaching/enable_cache","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file NginxCaching_enable_cache.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/NginxCaching_enable_cache.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/NginxCaching/,\n    q/enable_cache/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file NginxCaching_enable_cache.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/NginxCaching_enable_cache.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    'NginxCaching',\n    'enable_cache'\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-available-version":"cPanel 100","x-cpanel-api-version":"UAPI","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"properties":{}},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}}},"module":{"type":"string","description":"The name of the module called.","example":"NginxCaching"},"func":{"example":"enable_cache","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"summary":"Enable the user's NGINX cache"}}},"x-tagGroups":[{"tags":["NginxCaching"],"name":"Web Server Management"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The NginxCaching module for UAPI.","name":"NginxCaching"}]},"reset_cache_config":{"tags":[{"description":"The NginxCaching module for UAPI.","name":"NginxCaching"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"tags":["NginxCaching"],"name":"Web Server Management"}],"paths":{"/NginxCaching/reset_cache_config":{"get":{"description":"This function resets the user's NGINX caching configuration.\n\n**Note:**\n\n  - You can **only** use this function if you installed the `ea-nginx` package.","operationId":"reset_cache_config","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  NginxCaching \\\n  reset_cache_config\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/NginxCaching/reset_cache_config"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file NginxCaching_reset_cache_config.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/NginxCaching_reset_cache_config.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/NginxCaching/,\n    q/reset_cache_config/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file NginxCaching_reset_cache_config.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/NginxCaching_reset_cache_config.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    'NginxCaching',\n    'reset_cache_config'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["NginxCaching"],"x-cpanel-available-version":"cPanel 100","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"reset_cache_config","description":"The name of the method called.","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"NginxCaching"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"data":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null}},"type":"object"}},"type":"object"}}}}},"summary":"Reset the user's NGINX cache configuration","x-cpanel-api-version":"UAPI"}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"disable_cache":{"x-tagGroups":[{"tags":["NginxCaching"],"name":"Web Server Management"}],"paths":{"/NginxCaching/disable_cache":{"get":{"x-cpanel-api-version":"UAPI","summary":"Disable the user's NGINX cache","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"disable_cache","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"NginxCaching"},"result":{"properties":{"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"properties":{}},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}}}},"x-cpanel-available-version":"cPanel 100","tags":["NginxCaching"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  NginxCaching \\\n  disable_cache\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/NginxCaching/disable_cache"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file NginxCaching_disable_cache.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/NginxCaching_disable_cache.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/NginxCaching/,\n    q/disable_cache/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file NginxCaching_disable_cache.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/NginxCaching_disable_cache.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    'NginxCaching',\n    'disable_cache'\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}"}],"description":"This function disables the user's NGINX cache.\n\n**Note:**\n\n  - You can **only** use this function if you installed the `ea-nginx` package.","operationId":"disable_cache"}}},"tags":[{"description":"The NginxCaching module for UAPI.","name":"NginxCaching"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}}},"Branding":{"get_applications":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"description":"The Branding module for UAPI.","name":"Branding"},{"description":"cPanel Theme Management / Application Information","name":"Application Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"tags":["Application Information"],"name":"cPanel Theme Management"}],"paths":{"/Branding/get_applications":{"get":{"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"data":{"example":{"addon_domains":{"target":"","subtype":"img","acontent":"","group":"domains","itemorder":"3","key":"addon_domains","type":"image","plainitemdesc":"Addon Domains","if":"$HASROLE{'WebServer'}","height":"48","itemdesc":"Addon Domains","searchtext":"Domains Addon domain Addon Domains","imgtype":"icon","file":"addon_domains","url":"addon/index.html","onclick":"","width":"48","base64_png_image":"","feature":"addondomains","implements":"Domains_AddonDomains"},"anonymous_ftp":{"key":"anonymous_ftp","itemorder":"8","subtype":"img","acontent":"","group":"files","target":"","searchtext":"Anonymous FTP anonymousftp","itemdesc":"Anonymous FTP","height":"48","if":"$SERVICEPROVIDED{'ftp'} && $hasanonftp","type":"image","plainitemdesc":"Anonymous FTP","onclick":"","url":"ftp/anonymous.html","file":"anonymous_ftp","imgtype":"icon","touch":"ftp","feature":"ftpaccts","base64_png_image":"","width":"48"},"ftp_accounts":{"width":"48","base64_png_image":"","feature":"ftpaccts","touch":"ftp","imgtype":"icon","url":"ftp/accounts.html","file":"ftp_accounts","onclick":"","plainitemdesc":"FTP Accounts","type":"image","if":"$SERVICEPROVIDED{'ftp'}","height":"48","itemdesc":"FTP Accounts","searchtext":"FTP Accounts ftp create","target":"","acontent":"","subtype":"img","group":"files","itemorder":"6","key":"ftp_accounts"}},"additionalProperties":{"description":"The feature's details. The function returns an object for each\napplication feature.\n\n**Note:***\n\nThe property name corresponds to the name(s) specified\nin the `app_keys` parameter.","properties":{"subtype":{"type":"string","enum":["img"],"example":"img","description":"The item's subtype.\n\n* `img` is the only possible value."},"group":{"example":"advanced","description":"The item's group.","type":"string"},"itemorder":{"example":"4","description":"The application's order in the `dynamicui.conf`\nfile, representing the application's display order in\ncPanel's *Home* interface.\n\nFor example, the first item on the cPanel *Home* interface\nhas an `itemorder` value of `1`.","minimum":"1","type":"integer"},"height":{"type":"integer","minimum":"1","example":"48","description":"The application's icon's height, in pixels."},"type":{"type":"string","enum":["image"],"example":"image","description":"The application's type.\n\n* `image` is the only possible value."},"if":{"type":"string","example":"$is_reseller","description":"Conditional arguments that determine whether to display the item, if any exist.\n\nFor example, `$isreseller` indicates that the item **only** displays for reseller\naccounts.\n\nFor more information, read our\n[Guide to cPanel Variables](https://go.cpanel.net/guidetovariables)\ndocumentation."},"searchtext":{"type":"string","example":"Domains Addon domain","description":"A space-separated list of search terms. The item will display when users enter these search terms in the *Quick Find* textbox."},"itemdesc":{"description":"The application's display name. value.","example":"Addon Domain","type":"string"},"imgtype":{"example":"icon","enum":["icon"],"description":"The item's image type.\n\n* `icon` is the only possible value.","type":"string"},"url":{"type":"string","example":"addon/index.html","description":"The location to which the application's icon links.","format":"url-path"},"file":{"type":"string","example":"addon_domains","description":"The application's icon's filename."},"touch":{"type":"string","example":"ftp","description":"Conditional arguments that determine whether to display the item, if the touch file exists."},"width":{"minimum":"1","type":"integer","description":"The application's icon's width.","example":"48"},"implements":{"type":"string","example":"Domains_AddonDomains","description":"The `implements` value for the application. This corresponds to the `implements` field in the `dynamicui.conf` file."},"feature":{"example":"addondomains","description":"The feature name. The item will **only** display if the cPanel user has access to this feature.","type":"string"}},"type":"object"}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"Branding","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"get_applications"}},"type":"object"}}}}},"description":"This function retrieves an application's information from a specific theme's `dynamicui.conf` file.","operationId":"get_applications","parameters":[{"in":"query","name":"app_keys","required":"false","description":"A comma-separated list of an application feature names. If you do not specify this parameter,\nthe output will include all of the applications that the `dynamicui.conf` file contains.\n\n**Note:**\n\n* This value must match an application's `feature` value in the `dynamicui.conf` file.\n* For more information, read our [Guide to cPanel Interface Customization - Appkeys](https://go.cpanel.net/appkey) documentation.","schema":{"type":"string","example":"addon_domains,ftp_accounts,anonymous_ftp"}}],"summary":"Return multiple apps' info from dynamicui.conf","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Branding \\\n  get_applications\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Branding/get_applications"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Branding_get_applications.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Branding_get_applications.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/Branding/,\n    q/get_applications/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Branding_get_applications.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Branding_get_applications.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    'Branding',\n    'get_applications'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Branding","Application Information"]}}}},"get_application_information":{"paths":{"/Branding/get_application_information":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Branding \\\n  get_application_information \\\n  app_key='boxtrapper'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Branding/get_application_information?app_key=boxtrapper"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Branding_get_application_information.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Branding_get_application_information.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/Branding/,\n    q/get_application_information/,\n    {\n        'app_key' => 'boxtrapper',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Branding_get_application_information.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Branding_get_application_information.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    'Branding',\n    'get_application_information',\n    array (\n        'app_key' => 'boxtrapper',\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}"}],"tags":["Branding","Application Information"],"summary":"Return single app's info from dynamicui.conf","x-cpanel-api-version":"UAPI","description":"This function retrieves an application's information from the `dynamicui.conf` file.","operationId":"get_application_information","parameters":[{"description":"The application's feature name. This value **must** match a feature's `app_key` value. For a list of app_key values, read our [Guide to cPanel Interface Customization - Appkeys](https://go.cpanel.net/appkey) documentation.","schema":{"example":"boxtrapper","type":"string"},"in":"query","name":"app_key","required":"true"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"get_application_information","description":"The name of the method called."},"module":{"example":"Branding","description":"The name of the module called.","type":"string"},"result":{"properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"properties":{"module":{"description":"The application's module. A valid module name.","example":"BoxTrapper","type":"string"},"feature":{"type":"string","example":"boxtrapper","description":"The application's feature name. The `app_key` parameter's value."},"width":{"description":"The application's icon's width representing an image width, in pixels.","example":"35","type":"integer","minimum":"1"},"file":{"type":"string","example":"boxtrapper","description":"The application's icon's filename."},"url":{"description":"The location to which the application's icon links. A valid filepath or URL.","example":"mail/boxtrapper.html","type":"string"},"imgtype":{"description":"The item's image type.\n `icon` is the only possible value.","enum":["icon"],"example":"icon","type":"string"},"itemdesc":{"type":"string","description":"The application's display name.","example":"BoxTrapper"},"searchtext":{"type":"string","example":"boxtrapper","description":"One or more search terms. The application's icon will display when users enter these search terms in the Quick Find text box. A space-separated list of search terms."},"if":{"type":"string","description":"Conditional arguments that determine whether to display the item, if any exist. Conditional arguments that determine whether to display the item. For example, $isreseller indicates that the item only displays for reseller accounts. For more information, read our Guide to cPanel Variables documentation.","example":"$hasboxtrapper"},"type":{"type":"string","description":"The application's type.\n `image` is the only possible value.","enum":["image"],"example":"image"},"height":{"type":"integer","minimum":"1","description":"The application's icon's height, in pixels.","example":"32"},"itemorder":{"example":"3","description":"The application's order in the `dynamicui.conf` file representing the application's display order in cPanel's Home interface. For example, the first item on the cPanel Home interface has an `itemorder` value of `1`.","minimum":"1","type":"integer"},"subtype":{"type":"string","example":"img","enum":["img"],"description":"The item's subtype.\n `img` is the only possible value ."},"group":{"type":"string","example":"mail","description":"The application's group."}},"type":"object"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["Application Information"],"name":"cPanel Theme Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Branding","description":"The Branding module for UAPI."},{"name":"Application Information","description":"cPanel Theme Management / Application Information"}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"get_available_applications":{"tags":[{"name":"Branding","description":"The Branding module for UAPI."},{"name":"Application Information","description":"cPanel Theme Management / Application Information"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"cPanel Theme Management","tags":["Application Information"]}],"paths":{"/Branding/get_available_applications":{"get":{"summary":"Return current user's cPanel application details","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Branding \\\n  get_available_applications\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Branding/get_available_applications"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Branding_get_available_applications.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Branding_get_available_applications.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/Branding/,\n    q/get_available_applications/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Branding_get_available_applications.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Branding_get_available_applications.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    'Branding',\n    'get_available_applications'\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}"}],"tags":["Branding","Application Information"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"grouporder":{"type":"array","example":["files","databases","domains","email","metrics","security","software","advanced","preferences","pref"],"items":{"type":"string"},"description":"A list of group IDs, in the order in which the groups appear."},"default_group_order":{"description":"An object that defines the default order of applications in cPanel.","example":{"domains":"3","files":"1","software":"6","sample_apps":"9","advanced":"7","preferences":"8","metrics":"5","databases":"2","security":"6","email":"4"},"additionalProperties":{"description":"The group's default position.\n\n**Note:**\n\nThe property name is the group ID.","type":"integer"},"type":"object"},"groups":{"type":"array","items":{"properties":{"items":{"items":{"properties":{"height":{"example":"48","description":"The application icon height, in pixels.","type":"string"},"if":{"description":"An expression containing cPanel variables that determine whether\nto display the item. The function **only** returns this value if\nany variables exist.\n\nFor example, `$isreseller` indicates that the item **only**\ndisplays for reseller accounts.\n\nFor more information, read our\n[Guide to cPanel Variables documentation](https://go.cpanel.net/guidetovariables).","example":"$isreseller","type":"string"},"type":{"enum":["image"],"example":"image","description":"The application's type.\n\n`image` is the only possible value.","type":"string"},"searchtext":{"description":"One or more space-separated search terms.  The icon will display when users enter these search terms in the *Quick Find* text box in the cPanel interface.","example":"Domains Addon domain","type":"string"},"itemdesc":{"type":"string","description":"The application's display name.","example":"Addon Domain"},"acontent":{"example":"file_manager","description":"The content of a tag in the application's link.","type":"string"},"subtype":{"example":"img","enum":["img"],"description":"The item's subtype.\n\n`img` is the only possible value.","type":"string"},"group":{"example":"advanced","description":"The item's group.","type":"string"},"target":{"example":"file_manager","description":"The target of the application's link.","type":"string"},"itemorder":{"type":"string","example":"4","description":"The application's order in the `dynamicui.conf` file. This value represents the application's display order in cPanel's *Home* interface."},"base64_png_image":{"type":"string","format":"base64 image","description":"The application's icon in Base64 format."},"width":{"type":"string","example":"48","description":"The application's icon's width, in pixels."},"implements":{"type":"string","description":"The `implements` name of the application. WHM API 1's `create_user_session` and `get_users_links` functions use this value.","example":"Domains_AddonDomains"},"module":{"example":"My::Module","description":"The Perl module that the application requires.","type":"string"},"feature":{"type":"string","example":"addondomains","description":"A feature name. The icon **only** displays if the cPanel user can access this feature."},"file":{"type":"string","example":"addon_domains","description":"The application's icon's filename."},"url":{"example":"addon/index.html","format":"url-path","description":"The path to which the application's icon links.","type":"string"},"imgtype":{"type":"string","description":"The item's image type.\n\n`icon` is the only possible value.","example":"icon","enum":["icon"]},"touch":{"type":"string","example":"ftp","description":"Conditional arguments that determine whether to display the item, if a specified touch file exists."},"onclick":{"type":"string","description":"JavaScript function that the browser calls before or instead of URL navigation.","example":"function"}},"type":"object","example":{"file":"file_manager","url":"filemanager/index.html","imgtype":"icon","onclick":"","base64_png_image":"","width":"48","implements":"FileManager_Home","feature":"filemanager","subtype":"img","acontent":"target=\"file_manager\"","group":"files","target":"file_manager","key":"file_manager","itemorder":"1","height":"48","if":"$HASROLE{'FileStorage'}","plainitemdesc":"File Manager","type":"image","searchtext":"File Manager file-manager","itemdesc":"File Manager"}},"description":"The groups and their application details.","type":"array"},"desc":{"type":"string","description":"The group's description.","example":"Files"},"group":{"example":"files","description":"The group's ID.","type":"string"}},"type":"object"},"description":"Information about each group in the cPanel interface."},"index":{"description":"The applications and the order in which they appear in the cPanel interface.","example":{"optimize_website":["6","3"],"email_disk_usage":["3","15"],"backup_wizard":["0","6"],"mime_types":["7","6"],"email_deliverability":["3","9"],"bandwidth":["4","2"],"change_password":["8","0"],"autoresponders":["3","3"],"web_disk":["0","4"],"cron_jobs":["7","1"],"version_control":["0","7"],"webalizer":["4","6"],"redirects":["2","5"],"apache_spam_assassin":["3","11"],"perl_modules":["6","1"],"errors":["4","1"],"domains":["2","1"],"address_importer":["3","10"],"change_language":["8","1"],"calendar_and_contacts":["3","14"],"directory_privacy":["0","2"],"disk_usage":["0","3"],"subdomains":["2","3"],"ip_blocker":["5","1"],"backup":["0","5"],"file_manager":["0","0"],"user_manager":["8","4"],"site_software":["6","2"],"addon_domains":["2","2"],"track_dns":["7","2"],"indexes":["7","3"],"metrics_editor":["4","7"],"change_style":["8","2"],"images":["0","1"],"mysql_databases":["1","1"],"php_my_admin":["1","0"],"raw_access":["4","3"],"error_pages":["7","4"],"contact_information":["8","3"],"remote_mysql":["1","3"],"tls_status":["5","6"],"awstats":["4","4"],"mysql_database_wizard":["1","2"],"email_accounts":["3","0"],"multiphp_ini_editor":["6","5"],"forwarders":["3","1"],"analog_stats":["4","5"],"boxtrapper":["3","13"],"mailing_lists":["3","5"],"ssl_tls":["5","2"],"track_delivery":["3","6"],"leech_protection":["5","5"],"ssh_access":["5","0"],"email_filters":["3","8"],"visitors":["4","0"],"multiphp_manager":["6","4"],"php_pear_packages":["6","0"],"email_routing":["3","2"],"hotlink_protection":["5","4"],"encryption":["3","12"],"api_tokens":["5","3"],"aliases":["2","4"],"global_email_filters":["3","7"],"default_address":["3","4"],"site_publisher":["2","0"],"apache_handlers":["7","5"],"terminal":["7","0"],"zone_editor":["2","6"]},"type":"object","additionalProperties":{"items":{"type":"integer"},"description":"The order in which the application appears in the cPanel interface:\n* The first integer represents the group in which the application appears, starting at `0`.\n* The second integer represents the order in which the application appears in the group, starting at `0`.\n\n**Note:**\n\nThe array's name is the application's name.","type":"array"}},"implements":{"example":{"Email_AccountLevelFiltering":"global_email_filters","Calendar_Configure":"calendar_and_contacts","Email_DeliveryReport":"track_delivery","Email_SpamFilter":"apache_spam_assassin","Locale_Change":"change_language","Email_Forwarders":"forwarders","Email_Authentication":"email_deliverability","Email_BoxTrapper":"boxtrapper","Cron_Home":"cron_jobs","Email_Disk_Usage":"email_disk_usage","Backups_Home":"backup","Email_DefaultAddress":"default_address","Email_MailingLists":"mailing_lists","Password_Change":"change_password","FileManager_Home":"file_manager","SSL_TLS_Status":"tls_status","Database_MySQL":"mysql_databases","Domains_AddonDomains":"addon_domains","Site_Software":"site_software","Domains_SubDomains":"subdomains","Email_AutoResponders":"autoresponders","Stats_AWStats":"awstats","Email_UserLevelFiltering":"email_filters","SSL_TLS_Manager":"ssl_tls","Database_phpMyAdmin":"php_my_admin","Email_Routing":"email_routing","Email_Accounts":"email_accounts","API_Tokens_Manager":"api_tokens","ContactInfo_Change":"contact_information"},"description":"An object mapping the `implements` names to Appkey values for applications in cPanel.\n\nFor example, use this mapping to determine that the `implements`\nvalue `SSL_TLS_Status` maps to the Appkey value `tls_status`.\n\n**Note:**\n\n* The Appkey for an application can be found in the `key` attribute elsewhere in the API response.\n* The `implements` for an application can be found in the `implements` attribute elsewhere in the API response.\n* For more information about Appkey values, read our [Guide to cPanel Interface Customization - Appkeys](https://go.cpanel.net/paper-lantern-theme-guide-to-cpanel-interface-customization-appkeys) documentation.","type":"object","additionalProperties":{"description":"The application and its Appkey value.\n\n**Note:**\n\nThis return's name is the application's name, in its `implements` value format.","type":"string"}}}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"}},"type":"object"},"module":{"type":"string","example":"Branding","description":"The name of the module called."},"func":{"example":"get_available_applications","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","parameters":[{"in":"query","name":"nvarglist","required":"false","description":"A pipe-separated list of group names denoting the order in which to sort the\ngroups. If you do not supply a value, the function does not sort the groups.\n\n**Note:**\n\n`arglist` is an alias for this parameter.","schema":{"example":"pref|software|domains","type":"string"}}],"description":"This function retrieves information about the groups and applications in the authenticated user's cPanel interface.","operationId":"get_available_applications"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"include":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.136.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Branding module for UAPI.","name":"Branding"},{"description":"cPanel Theme Management / Branding Files","name":"Branding Files"}],"paths":{"/Branding/include":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"include"},"module":{"example":"Branding","description":"The name of the module called.","type":"string"},"result":{"properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"data":{"nullable":"true","description":"The rendered or retrieved content of the requested branding file.\nFor Template Toolkit files, this is the processed template output.\nFor other files, this is the raw or HTML-encoded file content.","example":"<div class=\"header\">Welcome</div>","type":"string"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"in":"query","name":"file","required":"true","examples":{"html_file":{"summary":"Include a standard HTML branding file.","value":"header.html"},"tt_file":{"summary":"Include a Template Toolkit branding file.","value":"header.tt"}},"description":"The relative path to the branding file within the theme directory.","schema":{"type":"string","example":"header.tt"}},{"required":"false","name":"skip_default","in":"query","schema":{"type":"integer","enum":["0","1"],"example":"0","default":"0"},"description":"Whether to skip the default branding fallback.\n\n* `1` — Do not fall back to the default branding file if the theme-specific\n  file does not exist. This parameter has no effect for accounts that do not\n  have a branding package assigned; the theme fallback is always applied in\n  that case.\n* `0` — Fall back to the default branding file. This is the default behavior."},{"required":"false","in":"query","name":"raw","schema":{"enum":["0","1"],"example":"0","default":"0","type":"integer"},"description":"Whether to return the raw file content without HTML encoding.\n\n* `1` — Return the raw file content.\n* `0` — Return HTML-encoded content. This is the default behavior.\n\nThis parameter has no effect when the file is a Template Toolkit (`.tt`) file."},{"in":"query","name":"data","required":"false","description":"A JSON-encoded object containing additional variables to pass to the\nTemplate Toolkit template when rendering a `.tt` file. This parameter\nis ignored for non-template files.","schema":{"type":"string","example":"{\"logoColor\":\"blue\",\"showBanner\":1}","format":"json"}}],"description":"This function retrieves and renders a branding file from the active theme.\nThe file may be a Template Toolkit (`.tt`) file or a standard HTML/image\nfile. When the file is a Template Toolkit file, the system processes it\nand returns the rendered output. Otherwise, the system returns the file's\nraw or HTML-encoded content.\noperationId: Branding::include","x-cpanel-api-version":"UAPI","summary":"Return branding file content from the active theme","tags":["Branding","Branding Files"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Branding \\\n  include \\\n  file='header.tt'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Branding/include?file=header.tt"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Branding_include.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Branding_include.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/Branding/,\n    q/include/,\n    {\n        'file' => 'header.tt',\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 $data;\n}\nelse {\n    # Report errors:\n    use JSON;\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Branding_include.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Branding_include.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    'Branding',\n    'include',\n    array (\n        'file' => 'header.tt',\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 $data;\n}\nelse {\n    // Report errors:\n    print json_encode($response['cpanelresult']['result']['errors'], JSON_PRETTY_PRINT);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();"}]}}},"x-tagGroups":[{"name":"cPanel Theme Management","tags":["Branding Files"]}]},"get_information_for_applications":{"x-tagGroups":[{"name":"cPanel Theme Management","tags":["Application Information"]}],"paths":{"/Branding/get_information_for_applications":{"get":{"parameters":[{"schema":{"format":"path","example":"/usr/local/cpanel/base/webmail/jupiter","type":"string"},"description":"The absolute path to the directory containing the `sitemap.json` file.\nThis is the path to your theme's document root.","required":"true","name":"docroot","in":"query"},{"in":"query","name":"app_keys","required":"false","description":"A comma-separated list of Appkey names. If you do **not**\nspecify this parameter, the output will include all of the applications that the\n`sitemap.json` file contains.\n\n**Note:**\n\nThis value **must** match an application's `key` value in the `sitemap.json` file.\nFor more information, read our\n[Guide to cPanel Interface Customization - Appkeys](https://go.cpanel.net/appkey)\ndocumentation.","schema":{"example":"email_filters","type":"string"}}],"description":"This function retrieves an application's information from a specific\ntheme's `sitemap.json` file.","operationId":"get_information_for_applications","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"data":{"type":"object","additionalProperties":{"properties":{"implements":{"description":"The module namespace for the specific application.","example":"Email_UserLevelFiltering","type":"string"},"type":{"type":"string","description":"The application's type.\n\n`item` is the only possible value.","example":"item","enum":["item"]},"condition":{"type":"object","properties":{"if":{"description":"cPanel variables that determine whether to display the\nitem, if any exist.\n\nFor example, `$isreseller` indicates that the item **only**\ndisplays for reseller accounts.\n\nFor more information, read our\n[Guide to cPanel Variables](https://go.cpanel.net/guidetovariables)\ndocumentation.","example":"!$isarchiveuser","type":"string"},"module":{"description":"The name of the module that provides the application.","type":"string"},"feature":{"description":"The feature that the user must have access to in order to see the application in their cPanel *Home* interface.","example":"blockers","type":"string"}},"description":"An object containing the application's conditions."},"terms":{"description":"Search keywords for the application.","items":{"type":"string"},"example":["email","filter","filters"]},"key":{"type":"string","example":"email_filters","description":"The application's Appkey name."},"icon":{"properties":{"height":{"example":"32","description":"The application's icon's height, in pixels.","type":"integer","minimum":"1"},"url":{"type":"string","example":"email_filters","format":"url-path","description":"The file path or URL location of the application's icon."},"width":{"example":"35","description":"The application's icon's width, in pixels.","minimum":"1","type":"integer"}},"type":"object","description":"The application's icon information."},"description":{"type":"string","example":"Email Filters","description":"The application's display name."},"order":{"minimum":"1","type":"integer","description":"The application's order in the `sitemap.json` file. This value represents the application's display order in cPanel's *Home* interface.","example":"4"},"url":{"example":"mail/filters/userfilters.html","description":"The file path or URL to the the application's file.","format":"url-path","type":"string"},"name":{"type":"string","example":"Email Filters","description":"The application's name."}},"type":"object","description":"An object containing information about the queried `app_keys` application.\n\n**Note:**\n\nThe object's name is the value specified in the `app_keys` parameter."}},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Branding"},"func":{"type":"string","example":"get_information_for_applications","description":"The name of the method called."}}}}}}},"x-cpanel-available-version":"cPanel 11.52","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Branding \\\n  get_information_for_applications \\\n  docroot='/usr/local/cpanel/base/webmail/jupiter'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Branding/get_information_for_applications?docroot=%2fusr%2flocal%2fcpanel%2fbase%2fwebmail%2fpaper_lantern","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Branding_get_information_for_applications.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Branding_get_information_for_applications.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/Branding/,\n    q/get_information_for_applications/,\n    {\n        'docroot' => '/usr/local/cpanel/base/webmail/jupiter',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Branding_get_information_for_applications.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Branding_get_information_for_applications.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    'Branding',\n    'get_information_for_applications',\n    array (\n        'docroot' => '/usr/local/cpanel/base/webmail/jupiter',\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}"}],"tags":["Branding","Application Information"],"summary":"Return app's info from sitemap.json","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The Branding module for UAPI.","name":"Branding"},{"description":"cPanel Theme Management / Application Information","name":"Application Information"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"openapi":"3.0.2"}},"Fileman":{"get_file_content":{"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Fileman module for UAPI.","name":"Fileman"},{"description":"Files / Manage Files","name":"Manage Files"}],"paths":{"/Fileman/get_file_content":{"get":{"parameters":[{"schema":{"type":"string","example":"/home/user/public.html","format":"path"},"description":"The file path to the directory that contains the selected file.","required":"true","in":"query","name":"dir"},{"schema":{"type":"string","example":"example.html"},"description":"The file to retrieve.","required":"true","in":"query","name":"file"},{"required":"false","name":"from_charset","in":"query","schema":{"type":"string","default":"_DETECT_","example":"_DETECT_"},"description":"The file’s character encoding. This parameter defaults to `_DETECT_`, which indicates a request to detect the file’s character encoding."},{"in":"query","name":"to_charset","required":"false","description":"The output character encoding. This parameter defaults to `_LOCALE_`, which indicates a request to use the session locale’s character encoding.\n\n**Important:**\n\nContexts that serialize the API response as JSON **require**\nthis value to be `utf-8` or `US-ASCII`. Behavior is **undefined**\nif the request indicates any other encoding.","schema":{"type":"string","example":"_LOCALE_","default":"_LOCALE_"}},{"in":"query","name":"update_html_document_encoding","required":"false","description":"Whether to update the file's HTML document encoding.\n\n* `1` — Update the file's HTML document encoding.\n* `0` — Don't update the file's HTML encoding.","schema":{"type":"integer","default":"1","example":"1","enum":["0","1"]}}],"operationId":"get_file_content","description":"This function retrieves a file's content.\n\n**Important:**\n\nWhen you disable the [File Storage](https://go.cpanel.net/serverroles) role, the system **disables** this function.\n\n**Note:**\n\nJSON strings **must** be valid UTF-8. To retrieve a non-UTF-8 file via\nJSON, we recommend that you give `ISO-8859-1` as `from_charset` and\n`UTF-8` as `to_charset`, then decode the return payload’s `content`\nas UTF-8.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"data":{"properties":{"from_char":{"example":"UTF-8","description":"The file's previous character encoding. If the request’s `from_charset` was `_DETECT_`, this will contain the detected encoding. Otherwise, it will contain the request’s `from_charset` value.","type":"string"},"content":{"type":"string","example":"`hi`","format":"binary","description":"The file's contents. A string value.\n\n**Note:**\n\nBehavior is **undefined** if the calling context\nrequires an encoding that conflicts with\nthe file contents. For example, if the file\ncontents are ISO-8859-1 but the context requires\nUTF-8 (as is the case with JSON), the system may\napply an extra layer of UTF-8 encoding in order\nto satisfy the request."},"filename":{"description":"The file's name.","example":"example.html","type":"string"},"dir":{"type":"string","description":"The absolute path to the directory that contains the selected file.","format":"path","example":"/home/user/public_html"},"path":{"description":"The absolute path to the file.","format":"path","example":"/home/user/public_html/example.html","type":"string"},"to_charset":{},"from_charset":{},"to_char":{"example":"UTF-8","description":"The file's new character encoding. If the request’s `from_charset` was `_LOCALE_`, this will contain the locale’s encoding. Otherwise, it will contain the request’s `to_charset` value.","type":"string"}},"type":"object"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Fileman"},"func":{"type":"string","description":"The name of the method called.","example":"get_file_content"}}}}}}},"x-cpanel-available-version":"cPanel 11.44","tags":["Fileman","Manage Files"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Fileman \\\n  get_file_content \\\n  dir='/home/user/public_html' \\\n  file='example.html'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Fileman/get_file_content?dir=%2fhome%2fuser%2fpublic.html&file=example.html","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Fileman_get_file_content.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Fileman_get_file_content.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/Fileman/,\n    q/get_file_content/,\n    {\n        'dir' => '/home/user/public.html',\n        'file' => 'example.html',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Fileman_get_file_content.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Fileman_get_file_content.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    'Fileman',\n    'get_file_content',\n    array (\n        'dir' => '/home/user/public.html',\n        'file' => 'example.html',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return file content"}}},"x-tagGroups":[{"name":"Files","tags":["Manage Files"]}],"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"transcode":{"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Fileman","description":"The Fileman module for UAPI."},{"description":"Files / Manage Files","name":"Manage Files"}],"paths":{"/Fileman/transcode":{"get":{"tags":["Fileman","Manage Files"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Fileman \\\n  transcode \\\n  content='hi'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Fileman/transcode?content=hi"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Fileman_transcode.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Fileman_transcode.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/Fileman/,\n    q/transcode/,\n    {\n        'content' => 'hi',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Fileman_transcode.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Fileman_transcode.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    'Fileman',\n    'transcode',\n    array (\n        'content' => 'hi',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Update buffer encoding","description":"This function converts a buffer from one encoding language to another.\n\n**Important:**\n\n  When you disable the [File Storage role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"transcode","parameters":[{"schema":{"type":"string","example":"hi"},"description":"The file's contents.","required":"true","name":"content","in":"query"},{"name":"from_charset","in":"query","required":"false","description":"The file's current [character set encoding](https://en.wikipedia.org/wiki/Character_encoding).","schema":{"example":"UTF-8","type":"string"}},{"required":"false","name":"to_charset","in":"query","schema":{"example":"ASCII","type":"string"},"description":"The [character set encoding](https://en.wikipedia.org/wiki/Character_encoding) in which to encode the file."},{"description":"Whether to discard any characters that do not transcode correctly.\n  * `1` - Discard invalid characters.\n  * `0` - Transcode invalid characters in the default [character set encoding](https://en.wikipedia.org/wiki/Character_encoding).","schema":{"enum":["0","1"],"example":"1","type":"integer"},"name":"discard_illegal","in":"query","required":"false"},{"description":"Whether to transcode invalid characters to valid characters in the new character set encoding.\n  * `1` - Transcode invalid characters in the new [character set encoding](https://en.wikipedia.org/wiki/Character_encoding).\n  * `0` - Return an error message.","schema":{"enum":["0","1"],"example":"0","type":"integer"},"name":"transliterate","in":"query","required":"false"}],"x-cpanel-available-version":"cPanel 11.44","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"transcode"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"charset":{"example":"ASCII","description":"The file's new character set.","type":"string"},"content":{"example":"hi","description":"The file's content.","type":"string"}}},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"}},"type":"object"},"module":{"description":"The name of the module called.","example":"Fileman","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["Manage Files"],"name":"Files"}]},"autocompletedir":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Fileman/autocompletedir":{"get":{"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"autocompletedir","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"Fileman"},"result":{"properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"status":{"type":"integer","description":"- `1` — Success.\n- `0` — Failed. Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"description":"An array of objects containing the files and directories that match the specified path.","items":{"type":"object","properties":{"file":{"example":"public_ftp","description":"A file or directory that matches the specified path.","type":"string"}}},"type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}}}}}},"description":"This function returns any files and directories that begin with a specified string.\n\n**Important:**\n\n  When you disable the [File Storage role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","operationId":"autocompletedir","parameters":[{"name":"path","in":"query","required":"true","description":"The prefix of the paths to complete.","schema":{"type":"string","example":"public"}},{"description":"Whether to include only directories in the output.\n* `1` — **Only** include directories.\n* `0` — Include directories **and** files.","schema":{"enum":["1","0"],"default":"0","type":"integer"},"name":"dirsonly","in":"query","required":"false"},{"description":"Whether to return all files and directories inside the specified\ndirectory. If you set this parameter's value to `1`, you **must** set the `path`\nparameter's value to a full directory path.\n* `1` — Return **all** files and directories inside the specified directory.\n* `0` — Return partial file and directory name matches.","schema":{"default":"1","enum":["1","0"],"type":"integer"},"in":"query","name":"list_all","required":"false"},{"description":"Whether to return HTML-encoded results.\n* `1` — Return HTML-encoded output.\n* `0` — Return plaintext output.","schema":{"type":"integer","example":"1","enum":["0","1"],"default":"1"},"in":"query","name":"html","required":"false"}],"x-cpanel-api-version":"UAPI","summary":"Return autocomplete file and directory names","tags":["Fileman","Manage Files"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Fileman \\\n  autocompletedir \\\n  path='public'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Fileman/autocompletedir?path=public"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Fileman_autocompletedir.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Fileman_autocompletedir.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/Fileman/,\n    q/autocompletedir/,\n    {\n        'path' => 'public',\n    }\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Fileman_autocompletedir.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Fileman_autocompletedir.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    'Fileman',\n    'autocompletedir',\n    array (\n        'path' => 'public',\n    )\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-tagGroups":[{"tags":["Manage Files"],"name":"Files"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Fileman","description":"The Fileman module for UAPI."},{"name":"Manage Files","description":"Files / Manage Files"}]},"list_files":{"tags":[{"description":"The Fileman module for UAPI.","name":"Fileman"},{"name":"Manage Files","description":"Files / Manage Files"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"Files","tags":["Manage Files"]}],"paths":{"/Fileman/list_files":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return directory content","tags":["Fileman","Manage Files"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Fileman \\\n  list_files \\\n  dir='public_html'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Fileman/list_files?dir=public_html"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Fileman_list_files.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Fileman_list_files.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/Fileman/,\n    q/list_files/,\n    {\n        'dir' => 'public_html',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Fileman_list_files.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Fileman_list_files.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    'Fileman',\n    'list_files',\n    array (\n        'dir' => 'public_html',\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}"}],"x-cpanel-available-version":"cPanel 11.44","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Fileman"},"result":{"properties":{"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"data":{"properties":{"files":{"description":"An array of objects containing information about each file.","items":{"type":"object","properties":{"rawmimename":{"example":"text-plain","description":"The file's raw MIME type's name.","type":"string"},"mode":{"type":"string","format":"unix-file-permission","description":"The file's textual permissions.","example":"16877"},"mimename":{"description":"The file's MIME type name.","example":"text-plain","type":"string"},"isleaf":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the directory contains subdirectories.\n\n* `1` — Contains subdirectories.\n* `0` — Does **not** contain subdirectories."},"absdir":{"example":"/home/user","format":"path","description":"The file path to the user's home directory.","type":"string"},"read":{"example":"1","enum":["0","1"],"description":"Whether the file is readable.\n\n* `1` — Readable.\n* `0` — **Not** readable.\n\n**Note:**\n\nThe function only returns this value if the `include_permissions` value is `1`.","type":"integer"},"rawmimetype":{"type":"string","example":"text/plain","description":"The file's raw MIME type."},"ctime":{"example":"1400573272","format":"unix_timestamp","description":"The file's creation time.","type":"integer"},"humansize":{"example":"5 KB","description":"The formatted size of the file. The function returns the size with\none of the following symbols:\n\n* `KB` — Kilobytes.\n* `MB` — Megabytes.\n* `GB` — Gigabytes.","type":"string"},"file":{"type":"string","description":"The filename.","example":"cgi-bin"},"write":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the file is writable.\n\n* `1` — Writable.\n* `0` — **Not** writable.\n\n**Note:**\n\nThe function only returns this value if the `include_permissions` value is `1`."},"path":{"description":"The absolute path to the file.","format":"path","example":"/home/user/public.html","type":"string"},"size":{"type":"integer","minimum":"1","description":"The file's size, in bytes.","example":"4096"},"mtime":{"description":"The file's last modification time.","format":"unix_timestamp","example":"1400573272","type":"integer"},"uid":{"description":"The file owner's system user ID.","example":"502","type":"integer","minimum":"1"},"mimetype":{"description":"The file's MIME type.","example":"text/plain","type":"string"},"nicemode":{"example":"755","format":"unix-file-permission","description":"The file's numerical permissions.","type":"integer"},"exists":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the file exists in the directory.\n\n* `1` — Exists.\n* `0` — Does **not** exist."},"gid":{"type":"integer","minimum":"1","example":"503","description":"The file owner's system group ID."},"type":{"description":"The item's type.\n\n* `file` — A file.\n* `dir` — A directory.\n* `char` — A character special device.\n* `block` — A block special device.\n* `fifo` - A named pipe (FIFO).\n* `link` — A symbolic link.\n* `socket` — A Unix domain socket.","example":"file","enum":["file","dir","char","block","fifo","link","socket"],"type":"string"},"fullpath":{"example":"/home/user/public_html/cgi-bin","format":"path","description":"The file's full file path.","type":"string"},"isparent":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the file is a parent record.\n\n* `1` — A parent record.\n* `0` — **Not** a parent record."}}},"type":"array"},"dirs":{"description":"An array of objects containing information about each directory.","items":{"type":"object","properties":{"isleaf":{"type":"integer","description":"Whether the directory contains subdirectories.\n\n* `1` — Contains subdirectories.\n* `0` — Does **not** contain subdirectories.","example":"1","enum":["0","1"]},"read":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the directory is readable.\n\n* `1` — Readable.\n* `0` — **Not** readable.\n\n**Note:**\n\nThe function only returns this value if the `include_permissions` value is `1`."},"absdir":{"type":"string","example":"/home/user","description":"The file path to the user's home directory.","format":"path"},"mimename":{"type":"string","example":"text-plain","description":"The MIME type's name."},"rawmimename":{"example":"text-plain","description":"The directory's raw MIME type's name.","type":"string"},"mode":{"format":"unix-file-permission","description":"The directory's textual permissions in [Unix format](http://en.wikipedia.org/wiki/File_system_permissions#Notation_of_traditional_Unix_permissions).","example":"16877","type":"string"},"exists":{"enum":["0","1"],"example":"1","description":"Whether the directory exists in the directory.\n\n* `1` — Exists.\n* `0` — Does **not** exist.","type":"integer"},"isparent":{"description":"Whether the directory is a parent record.\n\n* `1` — A parent record.\n* `0` — **Not** a parent record.","example":"1","enum":["0","1"],"type":"integer"},"fullpath":{"type":"string","example":"/home/user/public_html/cgi-bin","description":"The directory's full directory path.","format":"path"},"type":{"description":"The item's type.\n\n* `file` — A file.\n* `dir` — A directory.\n* `char` — A character special device.\n* `block` — A block special device.\n* `fifo` - A named pipe (FIFO).\n* `link` — A symbolic link.\n* `socket` — A Unix domain socket.","example":"file","enum":["file","dir","char","block","fifo","link","socket"],"type":"string"},"gid":{"description":"The directory owner's system group ID.","example":"503","type":"integer","minimum":"1"},"nicemode":{"type":"integer","example":"755","format":"unix-file-permission","description":"The directory's numerical permissions."},"mimetype":{"type":"string","example":"text/plain","description":"The directory's MIME's type."},"uid":{"example":"502","description":"The directory owner's system user ID.","type":"integer","minimum":"1"},"mtime":{"example":"1400573272","format":"unix_timestamp","description":"The directory's last modification time.","type":"integer"},"humansize":{"description":"The formatted size of the directory. The function returns the size with\none of the following symbols:\n\n* `KB` — Kilobytes.\n* `MB` — Megabytes.\n* `GB` — Gigabytes.","example":"5 KB","type":"string"},"ctime":{"type":"integer","format":"unix_timestamp","description":"The directory's creation date.","example":"1400573272"},"rawmimetype":{"type":"string","description":"The directory's raw MIME type.","example":"text/plain"},"size":{"example":"4096","description":"The directory's size, in bytes.","type":"integer","minimum":"1"},"path":{"example":"/home/user/public.html","description":"The path to the directory.","format":"path","type":"string"},"write":{"enum":["0","1"],"example":"1","description":"Whether the directory is writable.\n\n* `1` — Writable.\n* `0` — **Not** writable.\n\n**Note:**\n\nThe function only returns this value if the `include_permissions` value is `1`.","type":"integer"},"file":{"description":"The directory name.","example":"cgi-bin","type":"string"}}},"type":"array"}},"type":"object"},"status":{"enum":["0","1"],"example":"1","description":"* `1` — Success\n* `0` — Failed: Check the errors field for more details.","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"type":"string","example":"list_files","description":"The name of the method called."}}}}}}},"description":"This function returns a sorted list of files and directories.\n\n**Important:**\n\nWhen you disable the [FileStorage role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function. For more information, read our How to Use Server Profiles documentation.","operationId":"list_files","parameters":[{"name":"dir","in":"query","required":"true","description":"The directory from which to list files.","schema":{"example":"public_html","type":"string"}},{"style":"pipeDelimited","description":"A pipe-separated list of file types to return.\n\n* `file` — A file.\n* `dir` — A directory.\n* `char` — A character special device.\n* `block` — A block special device.\n* `fifo` — A named pipe (FIFO).\n* `link` — A symbolic link.\n* `socket` — A Unix domain socket.\n\nIf you do not use this parameter, the function returns all file types.","required":"false","in":"query","name":"types","schema":{"type":"array","items":{"example":"file|dir","type":"string"}},"explode":"false"},{"name":"limit_to_list","in":"query","required":"false","description":"Whether to return only entries that begin with the `filepath-` prefix.\n\n* `1` — Return only files that begin with the `filepath-` prefix.\n* `0` — Return **all** files.\n\nIf you do not use this parameter, the function returns all filenames.","schema":{"example":"0","enum":["0","1"],"type":"integer"}},{"schema":{"example":"cpbackup-exclude.conf","type":"string"},"description":"A comma-separated list of files to return.\n\nIf you do not use this parameter, the function returns all files.","required":"false","name":"only_these_files","in":"query"},{"required":"false","in":"query","name":"show_hidden","schema":{"type":"integer","example":"1","enum":["0","1"],"default":"0"},"description":"Whether to include hidden files in the output.\n\n* `1` — Include hidden files.\n* `0` — Do **not** include hidden files."},{"description":"Whether to return directories that contain subdirectories.\n\n* `1` — Return subdirectories.\n* `0` — Do **not** retain subdirectories.","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"name":"check_for_leaf_directories","in":"query","required":"false"},{"description":"The MIME types to return.\n\n* If you use this parameter, the function returns the specified MIME types\nand sets the `include_mime` parameter's value to `1`.\n* If you do **not** use this parameter, the function returns all MIME types.","schema":{"example":"text-plain","type":"string"},"in":"query","name":"mime_types","required":"false"},{"required":"false","in":"query","name":"raw_mime_types","schema":{"type":"string","example":"text/plain"},"description":"The raw MIME types to return.\n\n* If you use this parameter, the function returns the specified MIME types\nand sets the `include_mime` parameter's value to `1`.\n* If you do **not** use this parameter, the function returns all MIME types."},{"schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"},"description":"Whether to return the file's MIME type.\n\n* `1` — Include MIME type.\n* `0` — Do **not** include MIME type.\n\n**Note:**\n\n If you set this value to `0` but also include the `mime_types` or `raw_mime_types` parameters, the function **overrides** your specified value and sets this parameter to `1`.","required":"false","in":"query","name":"include_mime"},{"in":"query","name":"include_permissions","required":"false","description":"Whether to parse the file owner's read and write permissions.\n\n* `1` — Parse file permissions.\n* `0` — Do **not** parse file permissions.","schema":{"type":"integer","example":"0","enum":["0","1"],"default":"0"}}]}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"}},"get_file_information":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Fileman/get_file_information":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"properties":{"mimename":{"description":"The file's MIME name.","example":"publichtml","type":"string"},"mode":{"type":"string","description":"The file's textual permissions in [Unix format](https://en.wikipedia.org/wiki/File-system_permissions#Notation_of_traditional_Unix_permissions).","example":"16872"},"rawmimename":{"type":"string","example":"text/plain","format":"MIME","description":"The file's raw MIME name."},"uid":{"minimum":"1","type":"integer","description":"The file owner's system user ID.","example":"502"},"mtime":{"type":"integer","description":"The file's last modification time, in Unix time format.","format":"unix_timestamp","example":"1400573272"},"path":{"type":"string","description":"The file's path.","format":"path","example":"/home/user/public.html"},"write":{"type":"integer","description":"Whether the file is writable. The function only returns this value if you set the `include_permissions` value to 1 .\n* `1` - Writable.\n* `0` - Not writable.","enum":["0","1"],"example":"1"},"file":{"example":"cgi-bin","description":"The filename.","type":"string"},"size":{"example":"4096","description":"The file's size, in bytes.","type":"integer","minimum":"1"},"humansize":{"description":"The file's formatted size, followed by one of the following symbols:\n* `KB` - kilobytes\n* `MB` - megabytes\n* `GB` - gigabytes","example":"5 KB","type":"string"},"rawmimetype":{"type":"string","description":"The file's raw MIME type.","format":"MIME","example":"text/plain"},"ctime":{"example":"1400573272","description":"The file's creation time, Unix time format.","format":"unix_timestamp","type":"integer"},"gid":{"type":"integer","minimum":"1","example":"503","description":"The file owner's system group ID."},"type":{"type":"string","enum":["file","dir","char","block","fifo","link","socket"],"example":"file","description":"The item's type.\n* `file` - File.\n* `dir` - Directory.\n* `char` - Character special device.\n* `block` - Block special device.\n* `fifo` - Named pipe.\n* `link` - Symbolic link.\n* `socket` - Unix domain socket."},"fullpath":{"format":"path","description":"The file's full filepath.","example":"/home/user/public_html/cgi-bin","type":"string"},"exists":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the file exists in the directory.\n* `1` - Exists.\n* `0` - Does **not** exist."},"mimetype":{"description":"The file's MIME type.","format":"MIME","example":"text/plain","type":"string"},"read":{"example":"1","enum":["0","1"],"description":"Whether the file is readable. The function only returns this value if you set the `include_permissions` value to 1.\n* `1` - Readable.\n* `0` - **Not** readable.","type":"integer"},"nicemode":{"description":"The file's numerical permissions in [octal notation](https://en.wikipedia.org/wiki/File-system_permissions#Notation_of_traditional_Unix_permissions).","example":"755","type":"integer"},"absdir":{"example":"/home/user","format":"path","description":"The path to the user's home directory.","type":"string"},"isleaf":{"enum":["0","1"],"example":"1","description":"Whether the directory contains subdirectories.\n* `1` - Contains subdirectories.\n* `0` - Does **not** contain subdirectories.","type":"integer"}},"type":"object"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Fileman"},"func":{"example":"get_file_information","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.44","parameters":[{"schema":{"example":"public_html","format":"path","type":"string"},"description":"The directory from which to list files.","required":"true","in":"query","name":"path"},{"name":"show_hidden","in":"query","required":"false","description":"Whether to include hidden files in the output.\n\n* `1` - Include hidden files.\n* `0` - Do **not** include hidden files.","schema":{"example":"1","enum":["0","1"],"default":"0","type":"integer"}},{"schema":{"type":"integer","enum":["0","1"],"example":"1","default":"0"},"description":"Whether to flag directories that contain subdirectories.\n\n* `1` - Flag directories that contain subdirectories.\n* `0` - Do **not** flag directories that contain subdirectories.","required":"false","name":"check_for_leaf_directories","in":"query"},{"in":"query","name":"include_mime","required":"false","description":"Whether to return the file's MIME type.\n\n* `1` - Return the file's MIME type.\n* `0` - Do **not** return the file's MIME type.","schema":{"type":"integer","default":"0","example":"1","enum":["0","1"]}},{"description":"Whether to parse the file owner's read and write permissions.\n\n* `1` - Parse the file owner's read and write permissions.\n* `0` - Do **not** parse the file owner's read and write permissions.","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"name":"include_permissions","in":"query","required":"false"}],"description":"This function returns the information for a specified file or directory.\n\n**Important:**\n\nWhen you disable the [File Storage](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"get_file_information","summary":"Return file or directory information","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Fileman \\\n  get_file_information \\\n  path='public_html'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Fileman/get_file_information?path=public_html"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Fileman_get_file_information.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Fileman_get_file_information.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/Fileman/,\n    q/get_file_information/,\n    {\n        'path' => 'public_html',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Fileman_get_file_information.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Fileman_get_file_information.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    'Fileman',\n    'get_file_information',\n    array (\n        'path' => 'public_html',\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}"}],"tags":["Fileman","Manage Files"]}}},"x-tagGroups":[{"tags":["Manage Files"],"name":"Files"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Fileman module for UAPI.","name":"Fileman"},{"description":"Files / Manage Files","name":"Manage Files"}]},"upload_files":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"tags":[{"name":"Fileman","description":"The Fileman module for UAPI."},{"description":"Files / Manage Files","name":"Manage Files"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Manage Files"],"name":"Files"}],"paths":{"/Fileman/upload_files":{"get":{"description":"This function uploads files.\n\n**Note:**\n\n  For more information about how to use this function in your custom code,\n  read our [Use UAPI's `Fileman::upload_files` \n  Function in Custom Code tutorial](https://go.cpanel.net/tutorial-use-uapis-fileman-upload-files-function-in-custom-code). \n\n**Important:**\n\n When you disable the [File Storage](https://go.cpanel.net/serverroles) role, the system **disables** this function.\n\nYou cannot call this function through WHM API 1's [uapi_cpanel](https://go.cpanel.net/UseWHMAPItoCallcPanelAPIandUAPI) function.","operationId":"upload_files","tags":["Fileman","Manage Files"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"To implement Fileman::upload_files, read our Use UAPI's `Fileman::upload_files` Function in Custom Code tutorial."},{"source":"To implement Fileman::upload_files, read our Use UAPI's `Fileman::upload_files` Function in Custom Code tutorial.","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"To implement Fileman::upload_files, read our Use UAPI's `Fileman::upload_files` Function in Custom Code tutorial."},{"lang":"PHP","label":"LiveAPI PHP","source":"To implement Fileman::upload_files, read our Use UAPI's `Fileman::upload_files` Function in Custom Code tutorial."}],"x-cpanel-available-version":"cPanel 11.44","x-cpanel-api-version":"UAPI","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"Fileman","description":"The name of the module called."},"result":{"type":"object","properties":{"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"data":{"properties":{"content":{"description":"","format":"binary","example":"","type":"string"},"filename":{"type":"string","example":"example.png","description":"The file's name."}}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"upload_files"}}}}},"description":"HTTP Request was successful."}},"summary":"Upload files"}}}},"empty_trash":{"x-tagGroups":[{"tags":["Manage Files"],"name":"Files"}],"paths":{"/Fileman/empty_trash":{"get":{"x-cpanel-api-version":"UAPI","summary":"Delete .trash folder content","tags":["Fileman","Manage Files"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Fileman \\\n  empty_trash\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Fileman/empty_trash"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Fileman_empty_trash.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Fileman_empty_trash.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/Fileman/,\n    q/empty_trash/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Fileman_empty_trash.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Fileman_empty_trash.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    'Fileman',\n    'empty_trash'\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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"empty_trash","type":"string"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"metadata":{"properties":{}},"data":{"type":"object","properties":{},"nullable":"true","example":null},"status":{"description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"Fileman","description":"The name of the module called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 60","parameters":[{"name":"older_than","in":"query","required":"false","description":"The maximum age in days of content that the function will not purge.\n\n**Note:**\n\nA value of `0` will purge everything from the user's `.trash` folder.","schema":{"type":"integer","minimum":"0","example":"31","default":"0"}}],"description":"This function purges content from the `.trash` folder in the user's home directory.\n\n**Important:**\n\n  When you disable the [FileStorage role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.","operationId":"empty_trash"}}},"tags":[{"description":"The Fileman module for UAPI.","name":"Fileman"},{"name":"Manage Files","description":"Files / Manage Files"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"save_file_content":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"description":"The Fileman module for UAPI.","name":"Fileman"},{"description":"Files / Manage Files","name":"Manage Files"}],"paths":{"/Fileman/save_file_content":{"get":{"parameters":[{"name":"dir","in":"query","required":"false","description":"The directory that contains the selected file.\n\n**Note:**\n\nThis parameter defaults to the currently-authenticated user's `/home` directory.","schema":{"type":"string","example":"/home/username/public_html","format":"path"}},{"in":"query","name":"file","required":"true","description":"The files to retrieve.","schema":{"type":"string","example":"example.html"}},{"schema":{"type":"string","example":"UTF-8","default":"UTF-8"},"description":"The [character set encoding](https://en.wikipedia.org/wiki/Character_encoding) of the `content` parameter's value.","required":"false","name":"from_charset","in":"query"},{"required":"false","in":"query","name":"to_charset","schema":{"type":"string","default":"UTF-8","example":"ASCII"},"description":"The [character set encoding](https://en.wikipedia.org/wiki/Character_encoding) in which to encode the file."},{"name":"content","in":"query","required":"false","description":"The new file's contents. If you do **not** use this parameter, the function creates a blank file.","schema":{"type":"string","example":"hi"}},{"name":"fallback","in":"query","required":"false","description":"Whether the function will return an error or save in the default\ncharacter set if it cannot save in the specified character set.\n\n* `1` — Save in the default character set.\n* `0` — Return an error.","schema":{"type":"integer","enum":["0","1"],"example":"0","default":"1"}}],"operationId":"save_file_content","description":"This function saves a file in a directory and encodes it in a character set.\n\n**Important:**\n\n  When you disable the [File Storage role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"save_file_content"},"module":{"description":"The name of the module called.","example":"Fileman","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"status":{"enum":["0","1"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"properties":{"to_charset":{"type":"string","example":"ASCII","description":"The file's new character set."},"path":{"example":"/home/user/public_html/example.html","format":"path","description":"The path to the file.","type":"string"},"from_charset":{"description":"The file's character set.","example":"UTF-8","type":"string"}},"type":"object"},"metadata":{"properties":{}},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}},"type":"object"}}}}}}},"x-cpanel-available-version":"cPanel 11.44","tags":["Fileman","Manage Files"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Fileman \\\n  save_file_content \\\n  file='example.html'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Fileman/save_file_content?file=example.html","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Fileman_save_file_content.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Fileman_save_file_content.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/Fileman/,\n    q/save_file_content/,\n    {\n        'file' => 'example.html',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Fileman_save_file_content.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Fileman_save_file_content.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    'Fileman',\n    'save_file_content',\n    array (\n        'file' => 'example.html',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Save file"}}},"x-tagGroups":[{"name":"Files","tags":["Manage Files"]}]}},"WebmailApps":{"list_webmail_apps":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"openapi":"3.0.2","x-tagGroups":[{"name":"Email","tags":["Webmail Applications"]}],"paths":{"/WebmailApps/list_webmail_apps":{"get":{"parameters":[{"schema":{"type":"string","default":"the server's default theme","example":"jupiter"},"description":"The webmail theme.","required":"false","in":"query","name":"theme"}],"operationId":"list_webmail_apps","description":"This function lists the account's available webmail clients.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function. ","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"list_webmail_apps","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"data":{"items":{"properties":{"url":{"example":"/cpsess##########/3rdparty/roundcube/index.php","description":"The webmail client's URL.","format":"url-path","type":"string"},"id":{"description":"The webmail client's ID.","example":"roundcube","type":"string"},"icon":{"example":"/webmail/jupiter/images/roundcube_logo.png","description":"An icon file's path, relative to the `/usr/local/cpanel/base/frontend` directory.","type":"string"},"displayname":{"type":"string","example":"Roundcube","description":"The webmail client name, as it will display in the interface."}},"type":"object"},"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1","type":"integer"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"WebmailApps"}}}}}}},"x-cpanel-available-version":"cPanel 11.48","tags":["WebmailApps","Webmail Applications"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WebmailApps \\\n  list_webmail_apps\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WebmailApps/list_webmail_apps","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WebmailApps_list_webmail_apps.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WebmailApps_list_webmail_apps.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/WebmailApps/,\n    q/list_webmail_apps/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WebmailApps_list_webmail_apps.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WebmailApps_list_webmail_apps.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    'WebmailApps',\n    'list_webmail_apps'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return available webmail clients"}}},"tags":[{"name":"WebmailApps","description":"The WebmailApps module for UAPI."},{"name":"Webmail Applications","description":"Email / Webmail Applications"}],"servers":[{"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."}},"description":"A server running cPanel."}]}},"PassengerApps":{"enable_application":{"x-tagGroups":[{"tags":["Application Manager"],"name":"Web Server Management"}],"paths":{"/PassengerApps/enable_application":{"get":{"operationId":"enable_application","description":"This function enables a Passenger application and generates the Apache configuration on an account.\n\n**Important:**\n\nWhen you disable the [Web Server role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function. ","parameters":[{"description":"The Passenger application to enable on the account.","schema":{"example":"slippers","type":"string"},"in":"query","name":"name","required":"true"}],"x-cpanel-available-version":"cPanel 66","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"enable_application"},"module":{"type":"string","example":"PassengerApps","description":"The name of the module called."},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"nullable":"true","default":null,"type":"object"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the errors field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["PassengerApps","Application Manager"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  PassengerApps \\\n  enable_application \\\n  name='slippers'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/PassengerApps/enable_application?name=slippers","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file PassengerApps_enable_application.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/PassengerApps_enable_application.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/PassengerApps/,\n    q/enable_application/,\n    {\n        'name' => 'slippers',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file PassengerApps_enable_application.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/PassengerApps_enable_application.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    'PassengerApps',\n    'enable_application',\n    array (\n        'name' => 'slippers',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Enable Passenger application"}}},"tags":[{"name":"PassengerApps","description":"The PassengerApps module for UAPI."},{"description":"Web Server Management / Application Manager","name":"Application Manager"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"list_applications":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface’s features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"description":"The PassengerApps module for UAPI.","name":"PassengerApps"},{"description":"Web Server Management / Application Manager","name":"Application Manager"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Application Manager"],"name":"Web Server Management"}],"paths":{"/PassengerApps/list_applications":{"get":{"tags":["PassengerApps","Application Manager"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  PassengerApps \\\n  list_applications\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/PassengerApps/list_applications"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file PassengerApps_list_applications.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/PassengerApps_list_applications.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/PassengerApps/,\n    q/list_applications/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file PassengerApps_list_applications.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/PassengerApps_list_applications.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    'PassengerApps',\n    'list_applications'\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","summary":"Return Passenger applications","parameters":[],"description":"This function lists an account’s Passenger applications.\n\n**Important:**\n\n  When you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_applications","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"list_applications","description":"The name of the method called.","type":"string"},"module":{"example":"PassengerApps","description":"The name of the module called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"additionalProperties":{"description":"**Note**:\n\nThe top-level keys are the names of the applications.\n\nThe value is the object defined here.","type":"object","properties":{"enabled":{"description":"The application’s enabled status.\n\n* `1` — Enabled.\n* `0` — Disabled."},"envvars":{"description":"The environment variables set for the application.","nullable":"true","type":"object"},"deployment_mode":{"type":"string","description":"The deployment mode of the application.\n\n  * `development` — Sets the application to run in a development environment.\n  * `production` — Sets the application to run in a production environment.","enum":["production","development"],"example":"production"},"ruby":{"type":"string","example":"/opt/cpanel/ea-ruby27/root/usr/libexec/passenger-ruby27","description":"The path of the Ruby executable.\nPassenger uses Ruby to run the application.\n\n**Note**:\n\nThe function only returns this value if you configure this application to use\nRuby.","format":"path"},"path":{"type":"string","description":"The path of the application","format":"path","example":"/home/user/app-path"},"base_uri":{"description":"The URI of the application.","format":"url-path","example":"/uri-of-app","type":"string"},"name":{"type":"string","example":"My Application","description":"The name of the application"},"python":{"example":"/usr/bin/python","description":"The path of the Python executable.\nPassenger uses Python to run the application.\n\n**Note**:\n\nThe function only returns this value if you configure this application to use\nPython.","format":"path","type":"string"},"deps":{"properties":{"pip":{"type":"string","description":"The shell command to ensure python dependencies. It is `0` if there are no python dependencies.","example":"0"},"gem":{"type":"string","example":"0","description":"The shell command to ensure ruby dependencies. It is `0` if there are no ruby dependencies."},"npm":{"description":"The shell command to ensure node dependencies. It is `0` if there are no node dependencies.","example":"0","type":"string"}},"type":"object"},"domain":{"type":"string","example":"example.com","description":"The domain of the application","format":"domain"},"nodejs":{"type":"string","format":"path","description":"The path of the Nodejs executable.\nPassenger uses Nodejs to run the application.\n\n**Note**:\n\nThe function only returns this value if you configure this application to use\nNodejs.","example":"/opt/cpanel/ea-nodejs10/bin/node"}}},"type":"object","example":{"Name of Application 2":{"enabled":"1","envvars":{},"deployment_mode":"development","base_uri":"/app2-uri","name":"Name of Application 2","path":"/home/user/app2-dir","deps":{"npm":"0","gem":"cd /home/user/app2-dir && BUNDLE_PATH=~/.gem /path/to/ruby/version/package/bundler install","pip":"0"},"domain":"example.com"},"Name of Application 1":{"path":"/home/user/app1-dir","name":"Name of Application 1","base_uri":"/app1-uri","envvars":{},"enabled":"1","deployment_mode":"production","domain":"example.com","deps":{"gem":"0","pip":"cd /home/user/app1-dir && pip install --user -r requirements.txt","npm":"0"}}},"description":"An object describing each application."},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 66"}}}},"unregister_application":{"x-tagGroups":[{"name":"Web Server Management","tags":["Application Manager"]}],"paths":{"/PassengerApps/unregister_application":{"get":{"parameters":[{"required":"true","in":"query","name":"name","schema":{"example":"slippers","type":"string"},"description":"The application to unregister."}],"operationId":"unregister_application","description":"This function unregisters a [Passenger application](https://go.cpanel.net/cpaneldocsApplicationManager) on an account.\n\n**Note:**\n\n  * This function **only** unregisters an application. It does **not** delete the application. You **must** manually delete the application from your system.\n  * When you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"unregister_application","description":"The name of the method called.","type":"string"},"result":{"properties":{"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"data":{"type":"object","nullable":"true","default":null},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"description":"The name of the module called.","example":"PassengerApps","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 66","tags":["PassengerApps","Application Manager"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  PassengerApps \\\n  unregister_application \\\n  name='slippers'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/PassengerApps/unregister_application?name=slippers","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file PassengerApps_unregister_application.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/PassengerApps_unregister_application.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/PassengerApps/,\n    q/unregister_application/,\n    {\n        'name' => 'slippers',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file PassengerApps_unregister_application.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/PassengerApps_unregister_application.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    'PassengerApps',\n    'unregister_application',\n    array (\n        'name' => 'slippers',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Unregister Passenger application"}}},"tags":[{"description":"The PassengerApps module for UAPI.","name":"PassengerApps"},{"name":"Application Manager","description":"Web Server Management / Application Manager"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"openapi":"3.0.2"},"ensure_deps":{"tags":[{"description":"The PassengerApps module for UAPI.","name":"PassengerApps"},{"name":"Application Manager","description":"Web Server Management / Application Manager"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Application Manager"],"name":"Web Server Management"}],"paths":{"/PassengerApps/ensure_deps":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"data":{"properties":{"sse_url":{"type":"string","format":"url-path","description":"The SSE URI to track the progress of the process.","example":"/sse/UserTasks/00000000_5c6c8b18228a35/ensure_deps.log"},"task_id":{"type":"string","example":"00000000/5c76ec5566332c","description":"The task id of the SSE process."}},"type":"object"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{}}}},"module":{"type":"string","description":"The name of the module called.","example":"PassengerApps"},"func":{"type":"string","example":"ensure_deps","description":"The name of the method called."}}}}}}},"x-cpanel-available-version":"cPanel 80","parameters":[{"required":"true","name":"type","in":"query","schema":{"example":"npm","enum":["gem","npm","pip"],"type":"string"},"description":"The application’s type.\n\n* `gem` — Ensure ruby gems in the application’s `Gemfile` file.\n* `npm` — Ensure node packages in the application’s `package.json` file.\n* `pip` — Ensure python pips in the application’s `requirements.txt` file."},{"required":"true","in":"query","name":"app_path","schema":{"format":"path","example":"/home/example/my-app/","type":"string"},"description":"The application’s filepath."}],"operationId":"ensure_deps","description":"This function installs the dependencies for a Passenger application.\n\n**Note**:\n\n  This function starts the installation process. This may take a long time to complete.\n\n**Important**:\n\n  When you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","summary":"Install Passenger application dependencies","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  PassengerApps \\\n  ensure_deps \\\n  type='npm' \\\n  app_path='/home/example/my-app/'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/PassengerApps/ensure_deps?type=npm&app_path=%2fhome%2fexample%2fmy-app%2f"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file PassengerApps_ensure_deps.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/PassengerApps_ensure_deps.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/PassengerApps/,\n    q/ensure_deps/,\n    {\n        'type' => 'npm',\n        'app_path' => '/home/example/my-app/',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file PassengerApps_ensure_deps.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/PassengerApps_ensure_deps.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    'PassengerApps',\n    'ensure_deps',\n    array (\n        'type' => 'npm',\n        'app_path' => '/home/example/my-app/',\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}"}],"tags":["PassengerApps","Application Manager"]}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"disable_application":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"tags":[{"description":"The PassengerApps module for UAPI.","name":"PassengerApps"},{"description":"Web Server Management / Application Manager","name":"Application Manager"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Web Server Management","tags":["Application Manager"]}],"paths":{"/PassengerApps/disable_application":{"get":{"tags":["PassengerApps","Application Manager"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  PassengerApps \\\n  disable_application \\\n  name='slippers'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/PassengerApps/disable_application?name=slippers","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file PassengerApps_disable_application.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/PassengerApps_disable_application.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/PassengerApps/,\n    q/disable_application/,\n    {\n        'name' => 'slippers',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file PassengerApps_disable_application.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/PassengerApps_disable_application.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    'PassengerApps',\n    'disable_application',\n    array (\n        'name' => 'slippers',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Disable Passenger application","parameters":[{"in":"query","name":"name","required":"true","description":"The application to disable.","schema":{"example":"slippers","type":"string"}}],"operationId":"disable_application","description":"This function disables a Passenger application on an account.\n\n**Important:**\n\n  When you disable the [Web Server role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"PassengerApps"},"func":{"type":"string","description":"The name of the method called.","example":"disable_application"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 66"}}}},"register_application":{"paths":{"/PassengerApps/register_application":{"get":{"description":"This function registers a Passenger application for an account.\n\n**Important**:\n\n  * This function **only** registers an application. It does **not** create the application. You **must** create an application **before** you register the application. For an example of how to do this, read our [How to Create Ruby Web Applications](https://go.cpanel.net/howtocreaterubyapps) documentation.\n  * When you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"register_application","parameters":[{"schema":{"example":"Name of Application","minLength":"1","type":"string","maxLength":"50"},"description":"The application’s name.","required":"true","in":"query","name":"name"},{"schema":{"example":"/slippers","format":"path","type":"string"},"description":"The application’s filepath relative to the user’s home directory.","required":"true","in":"query","name":"path"},{"required":"true","in":"query","name":"domain","schema":{"type":"string","example":"dorothy.com","format":"domain"},"description":"The domain for which to register the application."},{"in":"query","name":"deployment_mode","required":"false","description":"The type of server environment in which to run the application.\n\n  * `development` — Sets the application to run in a development environment.\n  * `production` — Sets the application to run in a production environment.","schema":{"type":"string","default":"production","enum":["production","development"],"example":"production"}},{"description":"Environment variables that the application needs.\n\n**Note**:\n\n  For each `envvar_name` parameter you send, you **must** include an `envvar_value` parameter.\n\n  This parameter's value can only contain letters, numbers, underscores, and dashes, and cannot begin with a number. This parameter's value must also not exceed 256 characters.","style":"form","required":"false","in":"query","name":"envvar_name","explode":"true","schema":{"type":"array","maxLength":"256","items":{"type":"string"},"example":["SHOES","TINMAN"]}},{"schema":{"items":{"type":"string"},"example":["ruby","heart"],"maxLength":"1024","type":"array"},"explode":"true","style":"form","description":"Each environment variable’s value.\n\n**Note**:\n\n  For each `envvar_name` parameter you send, you **must** include an `envvar_value` parameter.\n\n  An environment variable value must contain 1024 or fewer ASCII-printable characters.","name":"envvar_value","in":"query","required":"false"},{"required":"false","name":"base_uri","in":"query","schema":{"type":"string","format":"url-path","default":"/","example":"/ruby"},"description":"The application’s base URI."},{"description":"Whether to enable the application and generate the web server configuration for it.\n\n  * `1` — Enable the application and generate the web server configuration.\n  * `0` — Don’t enable the application and generate the web server configuration.","schema":{"type":"integer","default":"1","enum":["0","1"],"example":"1"},"name":"enabled","in":"query","required":"false"}],"x-cpanel-available-version":"cPanel 66","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"metadata":{"properties":{}},"data":{"example":{"Name of Application":{"deployment_mode":"production","envvars":{"TINMAN":"heart","SHOES":"ruby"},"enabled":"1","name":"Name of Application","base_uri":"/ruby","path":"/home/dorothy/slippers","domain":"dorothy.com"}},"description":"An object describing the newly-registered application.","additionalProperties":{"description":"The application’s configuration information.\n\n  **Note**:\n\n  The top-level key is the name of the application.\n\n  The value is the object defined here.","properties":{"domain":{"type":"string","description":"The domain of the application."},"enabled":{"type":"integer","description":"Whether the application is enabled or not.\n\n  * `1` — Enabled.\n  * `0` — Disabled.","enum":["1","0"]},"envvars":{"description":"An object of the application’s environment variables and their values.","type":"object"},"deployment_mode":{"enum":["production","development"],"description":"The deployment mode of the application.\n\n  * `development` — Sets the application to run in a development environment.\n  * `production` — Sets the application to run in a production environment.","type":"string"},"base_uri":{"type":"string","format":"url-path","description":"The URI of the application."},"name":{"description":"The name of the application.","type":"string"},"path":{"description":"The path of the application inside the user’s home directory.","format":"path","type":"string"}}},"type":"object"},"status":{"type":"integer","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"module":{"example":"PassengerApps","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"register_application","type":"string"}}}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  PassengerApps \\\n  register_application \\\n  name='Name of Application' \\\n  path='/slippers' \\\n  domain='dorothy.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/PassengerApps/register_application?name=Name%20of%20Application&path=%2fslippers&domain=dorothy.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file PassengerApps_register_application.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/PassengerApps_register_application.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/PassengerApps/,\n    q/register_application/,\n    {\n        'name' => 'Name of Application',\n        'path' => '/slippers',\n        'domain' => 'dorothy.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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file PassengerApps_register_application.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/PassengerApps_register_application.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    'PassengerApps',\n    'register_application',\n    array (\n        'name' => 'Name of Application',\n        'path' => '/slippers',\n        'domain' => 'dorothy.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}"}],"tags":["PassengerApps","Application Manager"],"summary":"Register Passenger application","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Application Manager"],"name":"Web Server Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"PassengerApps","description":"The PassengerApps module for UAPI."},{"description":"Web Server Management / Application Manager","name":"Application Manager"}],"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface’s features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"edit_application":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The PassengerApps module for UAPI.","name":"PassengerApps"},{"name":"Application Manager","description":"Web Server Management / Application Manager"}],"paths":{"/PassengerApps/edit_application":{"get":{"parameters":[{"description":"The application’s current name.","schema":{"type":"string","example":"Ruby Slippers"},"in":"query","name":"name","required":"true"},{"required":"false","name":"new_name","in":"query","schema":{"example":"Little Dog","type":"string"},"description":"The application’s new name. If you do not use this parameter, the function does not change the application's name."},{"description":"The application’s new filepath. If you do not use this parameter, the function does not change the application’s filepath.","schema":{"format":"path","example":"/home/dorothy/littledog","type":"string"},"name":"path","in":"query","required":"false"},{"name":"domain","in":"query","required":"false","description":"The application’s new domain. If you do not use this parameter, the function does not change the application’s domain.","schema":{"format":"domain","example":"toto.com","type":"string"}},{"schema":{"type":"string","example":"production","enum":["production","development"]},"description":"The new server environment in which to run the application. If you do not use this parameter, the function does not change the application’s server environment.\n\n  * `development` — Sets the application to run in a development environment.\n  * `production` — Sets the application to run in a production environment.","required":"false","in":"query","name":"deployment_mode"},{"name":"envvar_name","in":"query","required":"false","style":"form","description":"New set of environment variables for the application.\n\n**Important**:\n\n The function replaces all current environment variables with the variables that you pass in this parameter.\n\n**Note**:\n\n  For each `envvar_name` parameter you send you **must** include an `envvar_value` parameter.","explode":"true","schema":{"type":"array","items":{"type":"string"},"example":["SCARECROW","TINMAN","LION"]}},{"schema":{"type":"array","minLength":"1","maxLength":"1024","items":{"type":"string"},"example":["brain","heart","courage"]},"description":"Each environment variable’s value.\n\n**Note**:\n\n  For each `envvar_name` parameter you send you **must** include an `envvar_value` parameter.","style":"form","required":"false","in":"query","name":"envvar_value"},{"required":"false","in":"query","name":"clear_envvars","schema":{"default":"0","enum":["0","1"],"example":"0","type":"integer"},"description":"Whether to clear the application’s environment variables."},{"name":"enabled","in":"query","required":"false","description":"Whether to enable the application and generate the web server configuration for it.\n\n  * `1` — Enable the application and generate the web server configuration.\n  * `0` — Don’t enable the application and generate the web server configuration.","schema":{"enum":["0","1"],"example":"1","default":"1","type":"integer"}}],"operationId":"edit_application","description":"This function edits a Passenger application for an account.\n\n**Note**:\n\n  When you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"PassengerApps","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"additionalProperties":{"description":"An object describing the newly-edited application.\n\n**Note**: `application_name` is the `name` of the application.","x-additionalPropertiesName":"application_name","properties":{"enabled":{"type":"integer","enum":["1","0"],"description":"Whether the application is enabled or not.\n\n  * `1` — Enabled.\n  * `0` — Disabled."},"envvars":{"description":"An object of the application’s environment variables and their values.","type":"object"},"deployment_mode":{"type":"string","enum":["production","development"],"description":"The deployment mode of the application."},"name":{"type":"string","description":"The name of the application."},"base_uri":{"format":"url-path","description":"The URI of the application.","type":"string"},"path":{"type":"string","description":"The path of the application inside the user’s home directory.","format":"path"},"domain":{"type":"string","format":"domain","description":"The domain of the application."}},"maxProperties":"1","type":"object"},"type":"object"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}}},"func":{"type":"string","example":"edit_application","description":"The name of the method called."}}},"example":{"metadata":{},"errors":null,"status":"1","data":{"Little Dog":{"domain":"toto.com","path":"/home/dorothy/littledog","base_uri":"/littledog","name":"Little Dog","envvars":{"TINMAN":"heart","LION":"courage","SCARECROW":"brain"},"enabled":"1","deployment_mode":"production"}},"messages":null}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 66","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  PassengerApps \\\n  edit_application \\\n  name='Ruby Slippers'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/PassengerApps/edit_application?name=Ruby%20Slippers","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file PassengerApps_edit_application.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/PassengerApps_edit_application.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/PassengerApps/,\n    q/edit_application/,\n    {\n        'name' => 'Ruby Slippers',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file PassengerApps_edit_application.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/PassengerApps_edit_application.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    'PassengerApps',\n    'edit_application',\n    array (\n        'name' => 'Ruby Slippers',\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}"}],"tags":["PassengerApps","Application Manager"],"summary":"Update Passenger application settings","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Web Server Management","tags":["Application Manager"]}],"openapi":"3.0.2","info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}},"VersionControlDeployment":{"delete":{"x-tagGroups":[{"tags":["Deployment Settings"],"name":"GIT Management"}],"paths":{"/VersionControlDeployment/delete":{"get":{"parameters":[{"schema":{"type":"string","example":"13"},"description":"The [Task Queue system's](https://go.cpanel.net/whmdocsTaskQueueMonitor) task ID number.","required":"true","in":"query","name":"deploy_id"}],"description":"This function deletes a deployment task. For more information, read our [Guide to Git - Deployment](https://go.cpanel.net/GitDeployment) documentation.","operationId":"delete","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"delete","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"VersionControlDeployment"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"nullable":"true","default":null,"type":"object"},"metadata":{"properties":{}}}}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 74","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  VersionControlDeployment \\\n  delete \\\n  deploy_id='13'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/VersionControlDeployment/delete?deploy_id=13"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file VersionControlDeployment_delete.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/VersionControlDeployment_delete.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/VersionControlDeployment/,\n    q/delete/,\n    {\n        'deploy_id' => '13',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file VersionControlDeployment_delete.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/VersionControlDeployment_delete.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    'VersionControlDeployment',\n    'delete',\n    array (\n        'deploy_id' => '13',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["VersionControlDeployment","Deployment Settings"],"summary":"Delete Git deployment task","x-cpanel-api-version":"UAPI"}}},"tags":[{"name":"VersionControlDeployment","description":"The VersionControlDeployment module for UAPI."},{"description":"GIT Management / Deployment Settings","name":"Deployment Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"},"openapi":"3.0.2"},"create":{"paths":{"/VersionControlDeployment/create":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"create","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"type":"object","properties":{"deploy_id":{"type":"string","example":"12","description":"The deployment ID number."},"task_id":{"description":"The Task Queue system's task ID number.","example":"00000000/5a9ec8dd4c345d","type":"string"},"log_path":{"type":"string","example":"/home/user/.cpanel/logs/vc_1525289545.785367_git_deploy.log","format":"path","description":"The absolute path to the task's log file vc_TIMESTAMP_git_deploy.log, where TIMESTAMP represents the time in Unix epoch time."},"timestamps":{"type":"object","properties":{"queued":{"description":"The time at which the deployment process. entered the task queue.","example":"1525289545.16293","type":"string"}},"description":"A hash of timestamps for the deployment process.","format":"object"},"sse_url":{"format":"url-path","description":"The SSE interface to track the progress of the deployment process.","example":"/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0","type":"string"},"repository_root":{"format":"path","description":"The repository's directory.","example":"/home/username/example","type":"string"}}},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"VersionControlDeployment","description":"The name of the module called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 74","parameters":[{"schema":{"type":"string","format":"path","example":"/home/user/public_html/example"},"description":"The repository's directory.","required":"true","name":"repository_root","in":"query"}],"operationId":"VersionControlDeployment::create","description":"This function deploys the changes from a cPanel-managed repository.\n\n**Important:**\n\nThe system logs messages for this function in the `~/.cpanel/logs/vc_TIMESTAMP_git_deploy.log` file, where TIMESTAMP represents the time in Unix epoch time. The system pulls changes with the `--ff-only` option and will only succeed if the branch's HEAD commit is up-to-date or Git can fast forward it. For more information about our suggested deployment configuration and how users can set it up, read our [Guide to Git™ - Deployment](https://go.cpanel.net/GitDeployment) documentation. Before deployment, repositories must meet the following requirements:\n  * A valid checked-in `.cpanel.yml` file in the top-level directory.\n  * One or more local or remote branches.\n  * A clean working tree.\n\nIf a repository does **not** meet these requirements, the system will **not** display deployment information. Also, it will disable deployment functionality. For more information, read our [Guide to Git™ - Deployment](https://go.cpanel.net/GitDeployment) documentation.","x-cpanel-api-version":"UAPI","summary":"Create Git deployment task","tags":["VersionControlDeployment","Deployment Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  VersionControlDeployment \\\n  create \\\n  repository_root='/home/user/public_html/example'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/VersionControlDeployment/create?repository_root=%2fhome%2fuser%2fpublic_html%2fexample","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file VersionControlDeployment_create.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/VersionControlDeployment_create.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/VersionControlDeployment/,\n    q/create/,\n    {\n        'repository_root' => '/home/user/public_html/example',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file VersionControlDeployment_create.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/VersionControlDeployment_create.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    'VersionControlDeployment',\n    'create',\n    array (\n        'repository_root' => '/home/user/public_html/example',\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"name":"GIT Management","tags":["Deployment Settings"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"VersionControlDeployment","description":"The VersionControlDeployment module for UAPI."},{"description":"GIT Management / Deployment Settings","name":"Deployment Settings"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"retrieve":{"paths":{"/VersionControlDeployment/retrieve":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"retrieve"},"module":{"description":"The name of the module called.","example":"VersionControlDeployment","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"items":{"type":"object","properties":{"log_path":{"type":"string","example":"/home/user/.cpanel/logs/vc_1525289448.759720_git_deploy.log","format":"path","description":"The absolute path to the task's log file."},"repository_root":{"description":"The aboslute path to the cPanel-managed repository directory.","format":"path","example":"/home/username/example","type":"string"},"task_id":{"description":"The [Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor) system's task ID number.","example":"00000000/5aea11e886a5d8","type":"string"},"deploy_id":{"type":"integer","example":"13","description":"The deployment ID number."},"sse_url":{"type":"string","description":"The SSE interface to track the progress of the deployment process.","format":"url-path","example":"/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0"},"timestamps":{"type":"object","properties":{"queued":{"description":"The time at which the deployment process entered the task queue, in Unix time format.","example":"1525289448.83553","type":"string"},"failed":{"type":"string","description":"The time at which the deployment process failed, in Unix time format.\n\n**Note:**\n\n* The function only returns this value if the deployment process failed.\n* The system logs messages for this function in the `~/.cpanel/logs/vc_TIMESTAMP_git_deploy.log` file, where `TIMESTAMP` represents the Unix timestamp.","example":"1525289448.83553"},"active":{"example":"1525289448.83553","description":"The time at which the system started the deployment process, in Unix time format.","type":"string"},"canceled":{"description":"The time at which the system cancelled the deployment process, in Unix time format.\n\n**Note:**\n\n* The function only returns this value if the system cancelled the deployment process.\n* The system logs messages for this function in the `~/.cpanel/logs/vc_TIMESTAMP_git_deploy.log` file, where `TIMESTAMP` represents the Unix timestamp.","example":"1525289448.83553","type":"string"},"succeeded":{"type":"string","description":"The time at which the deployment process finished successfully, in Unix time format.\n\n**Note:**\n\n The function only returns this value if the deployment process succeeded.","example":"1525289448.83553"}},"description":"An object containing timestamps for the deployment process."},"repository_state":{"description":"An object containing information about the repository's state at the time of deployment.","properties":{"branch":{"type":"string","description":"The repository's current branch.","example":"master"},"author":{"example":"Jane Doe <jane.doe@example.com>","description":"The most-recent commit's author's name and email address as they exist in the user's Git configuration files.","type":"string"},"date":{"format":"unix_timestamp","description":"The timestamp for the most-recent commit, in Unix time format.","example":"1410277881","type":"integer"},"identifier":{"description":"The identifier (SHA-1 value) for the most-recent commit.","example":"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12","type":"string"},"message":{"description":"The commit message.","example":"This is a commit.","type":"string"}},"type":"object"}}},"description":"An array of objects containing deployment task data.","type":"array"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 74","parameters":[],"operationId":"VersionControlDeployment::retrieve","description":"This function retrieves the status of deployment tasks. Before deployment, repositories must meet the following requirements:\n  * A valid checked-in `.cpanel.yml` file in the top-level directory.\n  * One or more local or remote branches.\n  * A clean working tree.\n\nIf a repository does **not** meet these requirements, the system will **not** display deployment information. Also, it will disable deployment functionality. For more information, read our [Guide to Git™ - Deployment](https://go.cpanel.net/GitDeployment) documentation.\n\n**Important:**\n\nThe system logs messages for this function in the `~/.cpanel/logs/vc_TIMESTAMP_git_deploy.log` file, where `TIMESTAMP` represents the time in Unix epoch time.","summary":"Return Git deployment task status","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  VersionControlDeployment \\\n  retrieve\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/VersionControlDeployment/retrieve","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file VersionControlDeployment_retrieve.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/VersionControlDeployment_retrieve.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/VersionControlDeployment/,\n    q/retrieve/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file VersionControlDeployment_retrieve.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/VersionControlDeployment_retrieve.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    'VersionControlDeployment',\n    'retrieve'\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}"}],"tags":["VersionControlDeployment","Deployment Settings"]}}},"x-tagGroups":[{"tags":["Deployment Settings"],"name":"GIT Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"name":"VersionControlDeployment","description":"The VersionControlDeployment module for UAPI."},{"description":"GIT Management / Deployment Settings","name":"Deployment Settings"}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}}},"StatsBar":{"get_stats":{"tags":[{"description":"The StatsBar module for UAPI.","name":"StatsBar"},{"name":"Resource Usage and Statistics","description":"cPanel Account / Resource Usage and Statistics"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"tags":["Resource Usage and Statistics"],"name":"cPanel Account"}],"paths":{"/StatsBar/get_stats":{"get":{"parameters":[{"schema":{"example":"bandwidthusage|diskusage","type":"string"},"description":"A pipe-delimited list of the account's statistics.\n\n<details>\n  <summary>Click for a list of available display parameters.</summary>\n\n  * `addondomains` — Information about the account's addon domains.\n  * `apacheversion` — The server's Apache version.\n  * `autoresponders` — Information about the account's auto-responders.\n  * `bandwidthusage` — Information about the account's bandwidth usage.\n  * `cachedlistdiskusage` — The amount of cached mailing list disk space the account currently uses.\n  * `cachedmysqldiskusage` — The amount of cached disk space that the account's MySQL® databases currently use.\n  * `cachedpostgresdiskusage` — The amount of cached disk space that the account's PostgreSQL databases use.\n  * `cpanelversion` — The server's cPanel version.\n  * `dedicatedip` — Account websites that use dedicated IP addresses.\n  * `diskusage` — Information the account's disk space usage.\n  * `emailaccounts` — Information about the account's email accounts.\n  * `emailfilters` — Information the account's email filters.\n  * `emailforwarders` — Information about the account's forwarders.\n  * `fileusage` — Information about the account's file usage.\n  * `ftpaccounts` — Information about the account's FTP accounts.\n  * `hostingpackage` — The account's hosting package.\n  * `hostname` — The server's hostname.\n  * `kernelversion` — The operating system's kernel version.\n  * `localip` — Account websites that use local IP addresses.\n  * `machinetype` — The type of operating system that the server uses.\n  * `mailinglists` — Information the account's mailing lists.\n  * `mysqldatabases` — The number of MySQL databases the account possesses.\n  * `mysqldiskusage` — The amount of disk space that the account's MySQL databases use.\n  * `mysqlversion` — The server's MySQL version.\n  * `operatingsystem` — The server's operating system.\n  * `parkeddomains` — Information about the account's parked domains (aliases).\n  * `perlpath` — The Perl binary's absolute path.\n  * `perlversion` — The server's Perl version.\n  * `phpversion` — The server's PHP version.\n  * `postgresqldatabases` — The number of PostgreSQL databases the cPanel account possesses.\n  * `postgresdiskusage` — The amount of disk space that the cPanel account's PostgreSQL databases use.\n  * `sendmailpath` — The path to the system's sendmail binary.\n  * `sharedip` — Any of the account's websites that use a shared IP address.\n  * `shorthostname` — The short version of your server's hostname.\n  * `sqldatabases` — Information about the all of the account's SQL databases.\n  * `subdomains` — Information about the account's subdomains.\n  * `theme` — The account's current theme.\n</details>\n\n**Note:**\n\n* This function may require URI-encode format (`%7C`) or quotes (`\"`) in some\ncontexts, such as the command line tool.\n* Some display parameters may be unavailable based on the server's configuration.","required":"true","in":"query","name":"display"},{"required":"false","name":"warnings","in":"query","schema":{"type":"integer","default":null,"example":"0","enum":["1","0"],"nullable":"true"},"description":"Whether to return all results with a warning.\n\n* `1` — Return only warnings that **exceed** the `warninglevel` parameter's\nvalue.\n* `0` — Return all results."},{"required":"false","in":"query","name":"warninglevel","schema":{"minimum":"1","type":"integer","maximum":"100","default":null,"example":"87","nullable":"true"},"description":"The minimum level at which to return warnings."},{"schema":{"type":"integer","default":null,"enum":["1","0"],"example":"0","nullable":"true"},"description":"Whether to display results with a value of `100%`.\n\n* `1` — Display results with a value of `100%`.\n* `0` — Hide results with a value of `100%`.","required":"false","in":"query","name":"warnout"},{"schema":{"type":"string","example":"/home/example/infinity.png","default":null,"nullable":"true"},"description":"The absolute file path to an alternative infinity symbol image.","required":"false","in":"query","name":"infinityimg"},{"schema":{"default":null,"example":"infinity","nullable":"true","type":"string"},"description":"A phrase to represent infinity that the locales system can use.","required":"false","in":"query","name":"infinitylang"},{"schema":{"type":"string","default":null,"example":"even","nullable":"true"},"description":"The type of row.\n\n* `odd`\n* `even`","required":"false","in":"query","name":"rowcounter"}],"operationId":"get_stats","description":"This function retrieves a cPanel account's statistics.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"data":{"type":"array","items":{"properties":{"percent20":{"type":"integer","multipleOf":"20","description":"The percentage of value that the system rounds to the nearest twenty, if applicable."},"phrase":{"type":"string","description":"The human-readable name of the queried item."},"maxed_phrase":{"type":"string","description":"The [`maketext`-formatted](https://go.cpanel.net/locale) message\nthat the interface displays when the user reaches their maximum\nallowed value."},"_maxed":{"type":"integer","enum":["1","0"],"description":"Whether the queried value reached its maximum value.\n\n* `1` — Reached maximum value.\n* `0` — Has **not** reached maximum value."},"_max":{"type":"string","description":"The queried parameter's limit."},"percent5":{"description":"The percentage of value that the system rounds to the nearest five, if applicable.","multipleOf":"5","type":"integer"},"is_maxed":{"description":"Whether the queried value has reached its maximum value.\n\n* `1` — The queried value has reached its maximum value.\n* `0` — The queried value has **not** reached its maximum value.","enum":["1","0"],"type":"integer"},"id":{"description":"The queried item's reference name.","type":"string"},"role":{"enum":["CalendarContact","DNS","FileStorage","FTP","MailLocal","MailReceive","MailSend","MySQL","Postgres","SpamFilter","Webmail","WebDisk","WebServer"],"description":"The queried value's role.\n\n* `CalendarContact`\n* `DNS`\n* `FileStorage`\n* `FTP`\n* `MailLocal`\n* `MailReceive`\n* `MailSend`\n* `MySQL`\n* `Postgres`\n* `SpamFilter`\n* `Webmail`\n* `WebDisk`\n* `WebServer`","type":"string"},"normalized":{"type":"integer","description":"Whether the function normalized the output values.\n\n* `1` — Normalized.\n* `0` — Did **not** normalize.","enum":["1","0"]},"zeroisunlimited":{"type":"integer","description":"Whether a value of `0` means unlimited or zero.\n\n* `1` — Unlimited.\n* `0` — Zero.","enum":["1","0"]},"count":{"description":"The queried data's value.","type":"string"},"_count":{"type":"string","description":"The queried data's value."},"feature":{"type":"string","description":"The queried item's feature name."},"item":{"description":"A human-readable version of the queried item.","type":"string"},"near_limit_phrase":{"description":"The [`maketext`-formatted](https://go.cpanel.net/locale) message\nthat the interface displays when the user approaches their\nmaximum allowed value.","type":"string"},"condition":{"enum":["1","0"],"description":"Whether the queried data's value possesses a conditional requirement.\n\n* `1` — Possesses a condition.\n* `0` — Does **not** possess a condition.\n\n**Note:**\n\nThe function will **only** return this value if it determines that the\nrelated statistic meets the subsystem installation requirements.","type":"integer"},"max":{"description":"The queried value's maximum limit.","type":"string"},"rowtype":{"enum":["even","odd"],"description":"The queried value's row type.\n\n* `even`\n* `odd`","type":"string"},"name":{"description":"The display key.","example":"diskusage","type":"string"},"percent":{"description":"The percentage of value, if applicable.","type":"integer"},"units":{"type":"string","description":"The queried value's unit of measure."},"percent10":{"description":"The percentage of value that the system rounds to the nearest ten, if applicable.","multipleOf":"10","type":"integer"},"module":{"description":"The module that retrieved the information.","example":"Quota","type":"string"}},"type":"object"},"description":"An array of objects containing results from the queried account.","example":[{"module":"Stats","percent10":"0","units":"MB","percent":"0","rowtype":"even","name":"bandwidthusage","max":"1 GB","near_limit_phrase":"You have transferred [format_bytes,_1] of your [format_bytes,_2] data allotment for this month.","item":"Monthly Bandwidth Transfer","feature":"bandwidth","_count":"0.00","count":"0 bytes","zeroisunlimited":"1","normalized":"1","id":"bandwidthusage","is_maxed":"0","percent5":"0","_maxed":"0","_max":"1024.00","maxed_phrase":"You have transferred your maximum allotment of data ([format_bytes,_1]) for this month.","phrase":"Monthly Bandwidth Transfer","percent20":"0"},{"percent":"0","name":"diskusage","rowtype":"odd","units":"MB","module":"Quota","percent10":"0","near_limit_phrase":"You are using [format_bytes,_1] of the [format_bytes,_2] of storage available to you.","item":"Disk Space Usage","max":"1 GB","id":"diskusage","normalized":"1","count":"1.75 MB","zeroisunlimited":"1","_count":"1.75","phrase":"Disk Space Usage","percent20":"0","maxed_phrase":"You are using your maximum storage allotment, [format_bytes,_1].","langkey":"INDXDiskUsage","_maxed":"0","_max":"1024.00","percent5":"0","is_maxed":"0"}]},"metadata":{"properties":{}}}},"module":{"description":"The name of the module called.","example":"StatsBar","type":"string"},"func":{"description":"The name of the method called.","example":"get_stats","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  StatsBar \\\n  get_stats \\\n  display='bandwidthusage|diskusage'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/StatsBar/get_stats?display=bandwidthusage%7cdiskusage"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file StatsBar_get_stats.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/StatsBar_get_stats.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/StatsBar/,\n    q/get_stats/,\n    {\n        'display' => 'bandwidthusage|diskusage',\n    }\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file StatsBar_get_stats.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/StatsBar_get_stats.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    'StatsBar',\n    'get_stats',\n    array (\n        'display' => 'bandwidthusage|diskusage',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["StatsBar","Resource Usage and Statistics"],"summary":"Return cPanel account statistics","x-cpanel-api-version":"UAPI"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}}},"Domain":{"is_temporary_domain":{"paths":{"/Domain/is_temporary_domain":{"get":{"description":"This function determines whether a domain is temporary.\n\n**Note:**\n\nFor more information about temporary domains, read our [Temporary Domains](https://go.cpanel.net/cp-temporary-domain) documentation.","operationId":"domain-is_temporary_domain","parameters":[{"required":"true","name":"domain","in":"query","schema":{"example":"example.com","format":"domain","type":"string"},"description":"A domain on the cPanel account."}],"x-cpanel-available-version":"130","responses":{"200":{"description":"Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"data":{"type":"integer","description":"Whether the domain is a temporary domain.\n* `1` - The domain is a temporary domain.\n* `0` -  The domains is **not** a temporary domain.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API call.","items":{"type":"string"},"example":null,"nullable":"true"}}},"module":{"example":"Domain","description":"The name of the module called.","type":"string"},"func":{"example":"is_temporary_domain","description":"The name of the method called.","type":"string"}}}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Domain \\\n  is_temporary_domain \\\n  domain=example.com\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Domain/is_temporary_domain?domain=example.com"}],"tags":["Domain","Temporary Domains"],"summary":"Return whether a domain is temporary","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Domain","tags":["Domain"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel.","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"description":"The Domain module for UAPI.","name":"Domain"}],"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.129.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"convert_temporary_to_registered":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel."},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"Domain","description":"The Domain module for UAPI."}],"paths":{"/Domain/convert_temporary_to_registered":{"post":{"tags":["Domain","Temporary Domains"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Domain \\\n  convert_temporary_to_registered \\\n  domain=wonderful-fushsia-owl.10-20-30-40.cpanel.site \\\n  registered=example.com\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Domain/convert_temporary_to_registered?domain=wonderful-fushsia-owl.10-20-30-40.cpanel.site&registered=example.com"}],"x-cpanel-api-version":"UAPI","summary":"Convert a temporary domain to a registered domain","parameters":[{"required":"true","in":"query","name":"domain","schema":{"example":"wonderful-fushsia-owl.10-20-30-40.cpanel.site","format":"domain","type":"string"},"description":"A valid temporary domain on the account."},{"required":"true","in":"query","name":"registered","schema":{"type":"string","format":"domain","example":"example.com"},"description":"A valid domain name."},{"required":"false","in":"query","name":"docroot","schema":{"type":"string","example":"example.com"},"description":"The path to the domain's document root directory. If you do not specify a\nvalue, this parameter defaults to the domain's name.\n\n**Note:**\n\nThe function will create a symlink in place of the previous temporary domain's\ndocument root directory. The symlink will point to the registered domain's\ndocument root."}],"operationId":"domain-convert_temporary_to_registered","description":"This function converts a temporary domain into a registered domain and moves its document root files\nto the new document root location.\n\n**Note:**\n\n* For more information about temporary domains, read our [Temporary Domains](https://go.cpanel.net/cp-temporary-domain) documentation.\n* You cannot use this function to convert a cPanel account's main domain.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"convert_temporary_to_registered","description":"The name of the method called."},"module":{"description":"The name of the module called.","example":"Domain","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API.","example":null,"nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success.\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"type":"object","properties":{"message":{"type":"string","description":"A message describing the result of the conversion.","example":"Domain wonderful-fushsia-owl.10-20-30-40.cpanel.site successfully converted to example.com"}}}},"type":"object"}},"type":"object"}}},"description":"Request was successful."}},"x-cpanel-available-version":"130"}}},"x-tagGroups":[{"name":"Domain Management","tags":["Domain"]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.129.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]}},"Ftp":{"get_port":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"description":"Files / FTP Server Settings","name":"FTP Server Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["FTP Server Settings"],"name":"Files"}],"paths":{"/Ftp/get_port":{"get":{"tags":["Ftp","FTP Server Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  get_port\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/get_port","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_get_port.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_get_port.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/Ftp/,\n    q/get_port/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_get_port.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_get_port.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    'Ftp',\n    'get_port'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return FTP server's port","parameters":[],"operationId":"get_port","description":"This function returns the FTP port.\n\n**Important:**\n\n  When you disable the [*FTP* role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Ftp"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed. Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"type":"object","properties":{"port":{"type":"integer","maximum":"65335","minimum":"1","description":"The FTP port.","example":"21"}}},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}},"type":"object"},"func":{"type":"string","description":"The name of the method called.","example":"get_port"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}}},"passwd":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Ftp/passwd":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"type":"object","default":null,"nullable":"true"},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"Ftp","description":"The name of the module called."},"func":{"type":"string","example":"passwd","description":"The name of the method called."}}}}}}},"description":"This function changes an FTP account's password.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"passwd","parameters":[{"in":"query","name":"domain","required":"false","description":"The user's associated domain.\n\n**Note:**\n\nThis parameter defaults to the cPanel account's primary domain","schema":{"type":"string","example":"example.com"}},{"name":"user","in":"query","required":"true","description":"The FTP account username.","schema":{"type":"string","example":"ftpaccount"}},{"description":"The FTP account's new password.","schema":{"example":"12345luggage","type":"string"},"in":"query","name":"pass","required":"true"}],"summary":"Update FTP account's password","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  passwd \\\n  user='ftpaccount' \\\n  pass='123456luggage'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/passwd?user=ftpaccount&pass=12345luggage","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_passwd.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_passwd.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/Ftp/,\n    q/passwd/,\n    {\n        'user' => 'ftpaccount',\n        'pass' => '12345luggage',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_passwd.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_passwd.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    'Ftp',\n    'passwd',\n    array (\n        'user' => 'ftpaccount',\n        'pass' => '12345luggage',\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}"}],"tags":["Ftp","FTP Accounts"]}}},"x-tagGroups":[{"tags":["FTP Accounts"],"name":"Files"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"description":"Files / FTP Accounts","name":"FTP Accounts"}]},"set_quota":{"paths":{"/Ftp/set_quota":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"set_quota","description":"The name of the method called."},"result":{"properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"data":{"default":null,"nullable":"true","type":"object"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"Ftp"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"in":"query","name":"user","required":"true","description":"The FTP account username.","schema":{"example":"ftpaccount","type":"string"}},{"required":"false","in":"query","name":"quota","schema":{"minimum":"0","type":"integer","example":"500","default":"0"},"description":"The new quota, in megabytes.\n\n**Note:**\n\nSetting this parameter to `0` grants the account unlimited disk space."},{"required":"false","name":"kill","in":"query","schema":{"type":"integer","example":"0","enum":["0","1"],"default":"0"},"description":"Whether to disable quotas for the FTP account.\n* `1` - Disable quotas.\n* `0` - Enable quotas.\n\n**Note:**\n\n If you disable quotas for an FTP account, you grant that account unlimited disk space."},{"schema":{"type":"string","example":"example.com","format":"domain"},"description":"The user's associated domain.\n\n**Note:**\n\nThe default value is the cPanel account's primary domain.","required":"false","name":"domain","in":"query"}],"operationId":"set_quota","description":"This function changes an FTP account's quota.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","x-cpanel-api-version":"UAPI","summary":"Update FTP account's quota","tags":["Ftp","FTP Accounts"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  set_quota \\\n  user='ftpaccount'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/set_quota?user=ftpaccount","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_set_quota.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_set_quota.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/Ftp/,\n    q/set_quota/,\n    {\n        'user' => 'ftpaccount',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_set_quota.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_set_quota.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    'Ftp',\n    'set_quota',\n    array (\n        'user' => 'ftpaccount',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"x-tagGroups":[{"tags":["FTP Accounts"],"name":"Files"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"name":"FTP Accounts","description":"Files / FTP Accounts"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"list_sessions":{"paths":{"/Ftp/list_sessions":{"get":{"summary":"Return FTP server's active sessions","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  list_sessions\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/list_sessions","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_list_sessions.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_list_sessions.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/Ftp/,\n    q/list_sessions/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_list_sessions.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_list_sessions.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    'Ftp',\n    'list_sessions'\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}"}],"tags":["Ftp","FTP Server Settings"],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"list_sessions","description":"The name of the method called.","type":"string"},"result":{"properties":{"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"items":{"properties":{"file":{"type":"string","description":"The file that the session is processing.\n\n**Note:**\n\nThe function returns a blank value if the session is idle.","example":""},"user":{"example":"ftpaccount","description":"The FTP account username.","type":"string"},"cmdline":{"example":"pure-ftpd (IDLE)","description":"Information about the FTP process, from the `ps` ([process status](http://www.linfo.org/ps.html)) command.","type":"string"},"login":{"type":"string","example":"Tue Apr 23 16:23:23 2020","description":"The FTP session login time."},"status":{"type":"string","description":"The session's status.\n- `IDLE` - The session is connected, but idle.\n- `DL` - A download is in progress.\n- `UL` - An upload is in progress.","example":"IDLE","enum":["IDLE","DL","UL"]},"host":{"oneOf":[{"format":"ipv4","type":"string"},{"format":"domain","type":"string"}],"example":"localhost","description":"The IP address or hostname that connected to the FTP server."},"pid":{"example":"6735","description":"The session's PID.","type":"integer","minimum":"1"}},"type":"object"},"type":"array"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details."},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Ftp","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"list_sessions","description":"This function lists the FTP server's active sessions.\n\n**Important:**\n\n  When you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[]}}},"x-tagGroups":[{"tags":["FTP Server Settings"],"name":"Files"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The Ftp module for UAPI.","name":"Ftp"},{"description":"Files / FTP Server Settings","name":"FTP Server Settings"}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"get_welcome_message":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"paths":{"/Ftp/get_welcome_message":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  get_welcome_message\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/get_welcome_message"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_get_welcome_message.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_get_welcome_message.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/Ftp/,\n    q/get_welcome_message/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_get_welcome_message.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_get_welcome_message.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    'Ftp',\n    'get_welcome_message'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Ftp","FTP Accounts"],"summary":"Return FTP account's welcome message","x-cpanel-api-version":"UAPI","operationId":"get_welcome_message","description":"This function retrieves the cPanel account's FTP welcome message.\n\n**Important:**\n\n  When you disable the [*FTP* role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_welcome_message","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"Ftp","description":"The name of the module called."},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"string","description":"The cPanel account's FTP welcome message.","example":"Greetings, Professor Falken."},"status":{"example":"1","enum":["0","1"],"description":"- `1` — Success.\n- `0` — Failed. Check the errors field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}},"type":"object"}}}}}}}}}},"x-tagGroups":[{"name":"Files","tags":["FTP Accounts"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"description":"The Ftp module for UAPI.","name":"Ftp"},{"name":"FTP Accounts","description":"Files / FTP Accounts"}]},"delete_ftp":{"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Ftp module for UAPI.","name":"Ftp"},{"name":"FTP Accounts","description":"Files / FTP Accounts"}],"paths":{"/Ftp/delete_ftp":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"type":"object","nullable":"true","default":null},"metadata":{"properties":{}}}},"module":{"description":"The name of the module called.","example":"Ftp","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"delete_ftp"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"description":"The user's associated domain.\n\n**Note:**\n\nThis parameter defaults to the cPanel account's primary domain.","schema":{"format":"domain","example":"example.com","type":"string"},"name":"domain","in":"query","required":"false"},{"in":"query","name":"user","required":"true","description":"The FTP account's username.","schema":{"example":"username","type":"string"}},{"description":"Whether to delete the FTP account's home directory.\n\n* `1` — Delete the home directory.\n* `0` — Do **not** delete the home directory.","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"in":"query","name":"destroy","required":"false"}],"description":"This function deletes an FTP account.\n\n**Important:**\n\nWhen you disable the [*FTP* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"delete_ftp","x-cpanel-api-version":"UAPI","summary":"Delete FTP account","tags":["Ftp","FTP Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  delete_ftp \\\n  user='username2'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/delete_ftp?user=username","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_delete_ftp.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_delete_ftp.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/Ftp/,\n    q/delete_ftp/,\n    {\n        'user' => 'username',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_delete_ftp.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_delete_ftp.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    'Ftp',\n    'delete_ftp',\n    array (\n        'user' => 'username',\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}"}]}}},"x-tagGroups":[{"tags":["FTP Accounts"],"name":"Files"}],"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"kill_session":{"tags":[{"name":"Ftp","description":"The FTP module for UAPI."},{"name":"FTP Server Settings","description":"Files / FTP Server Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"tags":["FTP Server Settings"],"name":"Files"}],"paths":{"/Ftp/kill_session":{"get":{"parameters":[{"description":"The username for the session's FTP account.\n\n**Note:**\n\n  To stop all FTP sessions for the cPanel account, set this parameter to the `all` value.","schema":{"example":"weeones","default":"all","type":"string"},"name":"login","in":"query","required":"false"}],"description":"This function kills FTP sessions.\n\n**Important:**\n\n  When you disable the [*FTP* Role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"kill_session","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"kill_session","description":"The name of the method called."},"module":{"description":"The name of the module called.","example":"Ftp","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"metadata":{"properties":{}},"data":{"default":null,"nullable":"true","type":"object"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the errors field for more details."},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"}}}}}}}}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  kill_session\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/kill_session","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_kill_session.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_kill_session.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/Ftp/,\n    q/kill_session/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_kill_session.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_kill_session.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    'Ftp',\n    'kill_session'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Ftp","FTP Server Settings"],"summary":"Stop FTP session","x-cpanel-api-version":"UAPI"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}}},"list_ftp_with_disk":{"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"description":"Files / FTP Accounts","name":"FTP Accounts"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Files","tags":["FTP Accounts"]}],"paths":{"/Ftp/list_ftp_with_disk":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  list_ftp_with_disk\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/list_ftp_with_disk"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_list_ftp_with_disk.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_list_ftp_with_disk.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/Ftp/,\n    q/list_ftp_with_disk/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_list_ftp_with_disk.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_list_ftp_with_disk.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    'Ftp',\n    'list_ftp_with_disk'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Ftp","FTP Accounts"],"summary":"Return FTP accounts and disk usage","x-cpanel-api-version":"UAPI","parameters":[{"required":"false","in":"query","name":"skip_acct_types","schema":{"type":"string","example":"main|anonymous"},"description":"A pipe-delimited list of the FTP account types to exclude from the function's\nresults. If you do not specify this parameter, the function does **not** exclude\nany account types.\n\nValid types for this list are:\n\n* `anonymous`\n* `logaccess`\n* `main`\n* `sub`"},{"required":"false","in":"query","name":"include_acct_types","schema":{"example":"main|anonymous","type":"string"},"description":"A pipe-delimited list of the FTP account types to include in the function's results.\nIf you do not specify this parameter, the function returns all FTP account types.\n\nValid types for this list are:\n\n* `anonymous`\n* `logaccess`\n* `main`\n* `sub`"}],"description":"This function lists FTP account and disk usage information.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_ftp_with_disk","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"Ftp","description":"The name of the module called.","type":"string"},"result":{"properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"type":"array","items":{"properties":{"_diskquota":{"type":"string","example":"476.84","description":"The FTP account's quota in megabytes, with two digits of fractional precision,\nencoded as a string. `0.00` means that the quota is unlimited.\n\n**Note:**\n\nThis value is different from the value for `diskquota`.","format":"^\\d+\\.\\d+$"},"login":{"type":"string","description":"The FTP account username.","example":"ftpaccount"},"accttype":{"description":"The type of FTP account.\n\n* `anonymous`\n* `logaccess`\n* `main`\n* `sub`","example":"sub","enum":["anonymous","logaccess","main","sub"],"type":"string"},"diskquota":{"oneOf":[{"type":"string","enum":["unlimited"]},{"format":"^\\d+\\.\\d+$","type":"string"}],"description":"The FTP account's quota.\n\n* `unlimited`\n* The disk quota in megabytes, with two digits of fractional precision, encoded as a string.\n\n**Note:**\n\nThis value is different from the value for `_diskquota`.","example":"476.84"},"dir":{"example":"/home/user/public_ftp","description":"The absolute path to the FTP account's document root.","type":"string"},"humandiskused":{"example":"2 MB","description":"The amount of disk space that the account currently uses, in\nhuman-readable format. The function formats this value as the\nquota's size, a space, and the characters `MB`.","type":"string"},"diskused":{"type":"string","description":"The amount of disk space in megabytes that the account currently uses,\nwith two digits of fractional precision, encoded as a string.\n\n**Note:**\n\nThis value is the same as the value for `_diskused`.","format":"^\\d+\\.\\d+$","example":"2.34"},"htmldir":{"type":"string","nullable":"true","description":"The path to the FTP account's HTML directory.","example":null},"_diskused":{"example":"2.34","description":"The amount of disk space in megabytes that the account currently uses,\nwith two digits of fractional precision, encoded as a string.\n\n**Note:**\n\nThis value is the same as the value for `diskused`.","format":"^\\d+\\.\\d+$","type":"string"},"deleteable":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the function's caller can delete the account.\n\n* `1` – The caller can delete the account.\n* `0` – The caller **cannot** delete the account."},"diskusedpercent":{"description":"The percentage of the disk space quota that the account currently uses.","example":"21","type":"integer"},"serverlogin":{"type":"string","description":"The full FTP login username.","example":"ftpaccount@example.com"},"diskusedpercent20":{"type":"integer","maximum":"100","minimum":"0","multipleOf":"20","description":"The percentage of disk space that the account currently uses, rounded in 20 percent increments.","example":"20"},"humandiskquota":{"type":"string","example":"477 MB","description":"The FTP account's quota, in human-readable format.\n\n* `None` — The function returns this value if the account has an unlimited quota.\n* The quota in megabytes (MB), a space, and the characters `MB`."},"reldir":{"type":"string","description":"The path to the FTP account's document root,\nrelative to the cPanel account's home directory.","example":"public_ftp"}},"type":"object"}},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"type":"string","description":"The name of the method called.","example":"list_ftp_with_disk"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}}},"get_quota":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"description":"Files / FTP Accounts","name":"FTP Accounts"}],"paths":{"/Ftp/get_quota":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"string","description":"The FTP account's quota.\n* `unlimited`\n* A positive integer that represents the maximum amount of disk space that the FTP account can use, in megabytes (MB).","example":"unlimited"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"Ftp","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"get_quota","type":"string"}}}}}}},"description":"This function checks an FTP account's quota.\n\n**Important:**\n\n  When you disable the [_FTP role_](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"get_quota","parameters":[{"in":"query","name":"account","required":"true","description":"The FTP account's username.","schema":{"example":"user1","type":"string"}},{"schema":{"type":"string","format":"domain","example":"example.com"},"description":"The user's associated domain.\n\n**Note:**\n\nThis parameter defaults to the cPanel account's primary domain.","required":"false","name":"domain","in":"query"}],"x-cpanel-api-version":"UAPI","summary":"Return FTP account's quota","tags":["Ftp","FTP Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  get_quota \\\n  account='user1'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/get_quota?account=user1"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_get_quota.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_get_quota.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/Ftp/,\n    q/get_quota/,\n    {\n        'account' => 'user1',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_get_quota.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_get_quota.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    'Ftp',\n    'get_quota',\n    array (\n        'account' => 'user1',\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}"}]}}},"x-tagGroups":[{"name":"Files","tags":["FTP Accounts"]}],"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"allows_anonymous_ftp":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"name":"FTP Server Settings","description":"Files / FTP Server Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["FTP Server Settings"],"name":"Files"}],"paths":{"/Ftp/allows_anonymous_ftp":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  allows_anonymous_ftp\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/allows_anonymous_ftp","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_allows_anonymous_ftp.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_allows_anonymous_ftp.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/Ftp/,\n    q/allows_anonymous_ftp/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_allows_anonymous_ftp.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_allows_anonymous_ftp.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    'Ftp',\n    'allows_anonymous_ftp'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Ftp","FTP Server Settings"],"summary":"Return if anonymous FTP connections allowed","x-cpanel-api-version":"UAPI","description":"This function checks whether the account allows anonymous FTP connections.\n\n**Important:**\n\nWhen you disable the [*FTP* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"allows_anonymous_ftp","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"allows_anonymous_ftp","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"Ftp"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"properties":{"allows":{"type":"integer","description":"Whether the cPanel account allows anonymous FTP connections.\n* `1` - Allowed.\n* `0` - **Not** allowed.","example":"1","enum":["0","1"]}},"type":"object"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"}},"type":"object"}}}}}}}}}}},"server_name":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/Ftp/server_name":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  server_name\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/server_name","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_server_name.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_server_name.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/Ftp/,\n    q/server_name/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_server_name.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_server_name.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    'Ftp',\n    'server_name'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Ftp","FTP Server Settings"],"summary":"Return whether server uses ProFTPD or Pure-FTPd","x-cpanel-api-version":"UAPI","operationId":"server_name","description":"This function checks whether the server uses ProFTPD or Pure-FTPd.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"type":"string","description":"The FTP server.\n* `pure-ftpd` - The Pure-FTPD server.\n* `proftpd` - The ProFTPD FTP server.\n* `disabled` - FTP has been disabled on this server.","example":"pure-ftpd","enum":["pure-ftpd","proftpd","disabled"]},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}},"type":"object"},"module":{"description":"The name of the module called.","example":"Ftp","type":"string"},"func":{"type":"string","example":"server_name","description":"The name of the method called."}},"type":"object"}}}}}}}},"x-tagGroups":[{"name":"Files","tags":["FTP Server Settings"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"name":"FTP Server Settings","description":"Files / FTP Server Settings"}]},"set_welcome_message":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["FTP Accounts"],"name":"Files"}],"paths":{"/Ftp/set_welcome_message":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  set_welcome_message \\\n  message='Greetings, Professor Falken.'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/set_welcome_message?message=Greetings%2c%20Professor%20Falken."},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_set_welcome_message.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_set_welcome_message.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/Ftp/,\n    q/set_welcome_message/,\n    {\n        'message' => 'Greetings, Professor Falken.',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_set_welcome_message.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_set_welcome_message.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    'Ftp',\n    'set_welcome_message',\n    array (\n        'message' => 'Greetings, Professor Falken.',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Ftp","FTP Accounts"],"summary":"Update FTP welcome message","x-cpanel-api-version":"UAPI","parameters":[{"description":"The cPanel account's new FTP welcome message.","schema":{"type":"string","example":"Greetings, Professor Falken."},"name":"message","in":"query","required":"true"}],"operationId":"set_welcome_message","description":"This function sets the FTP welcome message.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"set_welcome_message","description":"The name of the method called.","type":"string"},"module":{"example":"Ftp","description":"The name of the module called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"type":"object","nullable":"true","default":null},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"name":"FTP Accounts","description":"Files / FTP Accounts"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}]},"add_ftp":{"x-tagGroups":[{"tags":["FTP Accounts"],"name":"Files"}],"paths":{"/Ftp/add_ftp":{"get":{"tags":["Ftp","FTP Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  add_ftp \\\n  user='username2' \\\n  pass='123456luggage'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/add_ftp?user=username","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_add_ftp.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_add_ftp.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/Ftp/,\n    q/add_ftp/,\n    {\n        'user' => 'username',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_add_ftp.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_add_ftp.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    'Ftp',\n    'add_ftp',\n    array (\n        'user' => 'username',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Create FTP account","parameters":[{"required":"true","name":"user","in":"query","schema":{"type":"string","example":"username"},"description":"The new FTP account username."},{"schema":{"example":"123456luggage","type":"string"},"description":"The new FTP account password.\n\n**Note:**\n\nYou can use the `pass_hash` parameter in place of this parameter. However, you **cannot** use both the `pass` and `pass_hash` parameters in the same request.","required":"false","name":"pass","in":"query"},{"in":"query","name":"homedir","required":"false","description":"The path to the FTP account's root directory, relative to the cPanel account's home directory. If you don't set this, it defaults to a directory with the same name as the FTP account.","schema":{"type":"string","example":"exampleftp","format":"path"}},{"description":"The FTP account's maximum disk usage quota, in megabytes (MB).\n\n**Note:**\n\nA value of `0` grants the FTP account unlimited disk space.","schema":{"default":"0","example":"42","minimum":"0","type":"integer"},"in":"query","name":"quota","required":"false"},{"schema":{"type":"integer","default":"1","enum":["0","1"],"example":"1"},"description":"Whether to strip dots (`.`) from the username.\n\n* `1` — Strip dots.\n* `0` — Do **not** strip dots.","required":"false","in":"query","name":"disallowdot"},{"required":"false","name":"domain","in":"query","schema":{"type":"string","format":"domain","example":"example.com"},"description":"The FTP user's associated domain. This must be a domain that the cPanel account owns.\n\n**Note:**\n\nThis parameter defaults to the cPanel account's primary domain."},{"name":"pass_hash","in":"query","required":"false","description":"The account's password hash.\n\n**Note:**\n\n* You can use this parameter in place of the `pass` parameter. However, you **cannot** use both the `pass` and `pass_hash` parameters in the same request.\n* You can find your server's password hash type in the `/etc/sysconfig/authconfig` file.","schema":{"example":"$6$1sOyHP5ZDYp3pGUz$R0TSgfPRHfDjT5PP5RJGv39FhiGTNNPvM7IFpCBjXijMmlMZk9yI8T3LqGuntc9fdKb5eX.lGL7wBS9e4DAWn/","default":"","type":"string"}}],"description":"This function creates an FTP account.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"add_ftp","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"type":"object","nullable":"true","example":null,"enum":[null]},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"Ftp","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"add_ftp"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"description":"Files / FTP Accounts","name":"FTP Accounts"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"set_anonymous_ftp_incoming":{"tags":[{"description":"The Ftp module for UAPI.","name":"Ftp"},{"description":"Files / FTP Server Settings","name":"FTP Server Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"Files","tags":["FTP Server Settings"]}],"paths":{"/Ftp/set_anonymous_ftp_incoming":{"get":{"operationId":"set_anonymous_ftp_incoming","description":"This function enables or disables inbound anonymous FTP transfers.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"name":"set","in":"query","required":"false","description":"Whether to enable or disable inbound anonymous FTP transfers.\n\n* `1` - Enable.\n* `0` - Disable.","schema":{"default":"0","enum":["0","1"],"example":"0","type":"integer"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"Ftp","description":"The name of the module called.","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{}},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"type":"object","nullable":"true","default":null}}},"func":{"description":"The name of the method called.","example":"set_anonymous_ftp_incoming","type":"string"}}}}}}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  set_anonymous_ftp_incoming\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/set_anonymous_ftp_incoming"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_set_anonymous_ftp_incoming.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_set_anonymous_ftp_incoming.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/Ftp/,\n    q/set_anonymous_ftp_incoming/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_set_anonymous_ftp_incoming.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_set_anonymous_ftp_incoming.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    'Ftp',\n    'set_anonymous_ftp_incoming'\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}"}],"tags":["Ftp","FTP Server Settings"],"summary":"Enable or disable anonymous incoming FTP transfers","x-cpanel-api-version":"UAPI"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"get_ftp_daemon_info":{"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Ftp module for UAPI.","name":"Ftp"},{"description":"Files / FTP Server Settings","name":"FTP Server Settings"}],"paths":{"/Ftp/get_ftp_daemon_info":{"get":{"summary":"Return FTP server's information","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  get_ftp_daemon_info\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/get_ftp_daemon_info"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_get_ftp_daemon_info.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_get_ftp_daemon_info.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/Ftp/,\n    q/get_ftp_daemon_info/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_get_ftp_daemon_info.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_get_ftp_daemon_info.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    'Ftp',\n    'get_ftp_daemon_info'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Ftp","FTP Server Settings"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_ftp_daemon_info"},"result":{"type":"object","properties":{"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"properties":{"enabled":{"type":"integer","description":"Whether the server's FTP daemon is enabled.\n\n* `1` – Enabled.\n* `0` – Disabled.","example":"1","enum":["0","1"]},"supports":{"description":"This object contains the features that the FTP daemon supports.","properties":{"quota":{"example":"1","enum":["0","1"],"description":"Whether the FTP daemon supports disk quotas.\n\n* `1` – Supported.\n* `0` – **Not** supported.","type":"integer"},"login_without_domain":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the FTP daemon supports username authentication without the user's domain.\n\n* `1` – Supported.\n* `0` – **Not** supported."}},"type":"object"},"name":{"type":"string","enum":["pure-ftpd","proftpd",""],"example":"pure-ftpd","description":"The FTP server's name.\n\n* `pure-ftpd`\n* `proftpd`\n* An empty string."}},"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Ftp"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 54","parameters":[],"description":"This function retrieves the extended information about the server's FTP daemon.","operationId":"get_ftp_daemon_info"}}},"x-tagGroups":[{"tags":["FTP Server Settings"],"name":"Files"}],"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"set_anonymous_ftp":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"description":"The Ftp module for UAPI.","name":"Ftp"},{"description":"Files / FTP Server Settings","name":"FTP Server Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"name":"Files","tags":["FTP Server Settings"]}],"paths":{"/Ftp/set_anonymous_ftp":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  set_anonymous_ftp\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/set_anonymous_ftp","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_set_anonymous_ftp.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_set_anonymous_ftp.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/Ftp/,\n    q/set_anonymous_ftp/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_set_anonymous_ftp.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_set_anonymous_ftp.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    'Ftp',\n    'set_anonymous_ftp'\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}"}],"tags":["Ftp","FTP Server Settings"],"summary":"Enable or disable anonymous FTP logins","x-cpanel-api-version":"UAPI","operationId":"set_anonymous_ftp","description":"This function enables or disables anonymous FTP logins.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"type":"integer","enum":["0","1"],"example":"0","default":"0"},"description":"Whether to enable or disable anonymous FTP logins.\n\n* `1` - Enable.\n* `0` - Disable.","required":"false","name":"set","in":"query"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"Ftp","description":"The name of the module called.","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"metadata":{"properties":{}},"data":{"nullable":"true","default":null,"type":"object"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"}}},"func":{"description":"The name of the method called.","example":"set_anonymous_ftp","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}}},"set_homedir":{"openapi":"3.0.2","info":{"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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"name":"FTP Accounts","description":"Files / FTP Accounts"}],"paths":{"/Ftp/set_homedir":{"get":{"tags":["Ftp","FTP Accounts"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  set_homedir \\\n  user='example1'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/set_homedir?user=example1"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_set_homedir.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_set_homedir.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/Ftp/,\n    q/set_homedir/,\n    {\n        'user' => 'example1',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_set_homedir.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_set_homedir.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    'Ftp',\n    'set_homedir',\n    array (\n        'user' => 'example1',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Update FTP account's home directory","operationId":"set_homedir","description":"This function changes the home directory for FTP accounts.\n\n**Important:**\n\nWhen you disable the [FTP role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"required":"true","name":"user","in":"query","schema":{"type":"string","example":"example1"},"description":"The FTP account username."},{"schema":{"example":"example.com","format":"domain","type":"string"},"description":"The user's associated domain.\n\n**Note:**\n\nThe default value is the cPanel account's primary domain.","required":"false","name":"domain","in":"query"},{"name":"homedir","in":"query","required":"false","description":"The FTP account's home directory\n\n**Note:**\n\nThis parameter defaults to the `user@domain` subdirectory in the cPanel account's home directory with the name, where user and domain represent the `user` and `domain` parameters.","schema":{"type":"string","example":"example1/","format":"path","default":"user@domain/"}}],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"data":{"nullable":"true","default":null,"type":"object"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"}}},"module":{"type":"string","description":"The name of the module called.","example":"Ftp"},"func":{"example":"set_homedir","description":"The name of the method called.","type":"string"}}}}}}}}}},"x-tagGroups":[{"tags":["FTP Accounts"],"name":"Files"}]},"ftp_exists":{"x-tagGroups":[{"tags":["FTP Accounts"],"name":"Files"}],"paths":{"/Ftp/ftp_exists":{"get":{"parameters":[{"in":"query","name":"domain","required":"false","description":"The user's associated domain.\n\n**Note:**\n\nThis parameter defaults to the cPanel account's primary domain.","schema":{"type":"string","example":"example.com","format":"domain"}},{"description":"The FTP account's username.","schema":{"example":"us_chickens","type":"string"},"in":"query","name":"user","required":"true"}],"description":"This function checks whether an FTP account exists.\n\n**Note:**\n\nThis function returns only metadata if the FTP account exists, or an error if the FTP account does **not** exist.","operationId":"ftp_exists","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Ftp"},"result":{"properties":{"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"default":null,"nullable":"true","type":"object"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"type":"string","description":"The name of the method called.","example":"ftp_exists"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  ftp_exists \\\n  user='us_chickens'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/ftp_exists?user=us_chickens"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_ftp_exists.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_ftp_exists.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/Ftp/,\n    q/ftp_exists/,\n    {\n        'user' => 'us_chickens',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_ftp_exists.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_ftp_exists.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    'Ftp',\n    'ftp_exists',\n    array (\n        'user' => 'us_chickens',\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}"}],"tags":["Ftp","FTP Accounts"],"summary":"Return whether an FTP account exists","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The Ftp module for UAPI.","name":"Ftp"},{"description":"Files / FTP Accounts","name":"FTP Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"allows_anonymous_ftp_incoming":{"tags":[{"description":"The Ftp module for UAPI.","name":"Ftp"},{"description":"Files / FTP Server Settings","name":"FTP Server Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["FTP Server Settings"],"name":"Files"}],"paths":{"/Ftp/allows_anonymous_ftp_incoming":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  allows_anonymous_ftp_incoming\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/allows_anonymous_ftp_incoming","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_allows_anonymous_ftp_incoming.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_allows_anonymous_ftp_incoming.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/Ftp/,\n    q/allows_anonymous_ftp_incoming/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_allows_anonymous_ftp_incoming.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_allows_anonymous_ftp_incoming.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    'Ftp',\n    'allows_anonymous_ftp_incoming'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Ftp","FTP Server Settings"],"summary":"Return if anonymous FTP transfers allowed","x-cpanel-api-version":"UAPI","parameters":[],"description":"This function checks whether the account allows inbound anonymous FTP transfers.\n\n**Important:**\n\n  When you disable the [*FTP* role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","operationId":"allows_anonymous_ftp_incoming","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"allows_anonymous_ftp_incoming","description":"The name of the method called."},"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"data":{"properties":{"allows":{"type":"integer","description":"Whether the cPanel account allows inbound anonymous FTP transfers.\n* `1` - Allowed.\n* `0` - Not allowed.","enum":["0","1"],"example":"1"}},"type":"object"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"description":"The name of the module called.","example":"Ftp","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"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/","version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"}},"list_ftp":{"x-tagGroups":[{"tags":["FTP Accounts"],"name":"Files"}],"paths":{"/Ftp/list_ftp":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Ftp \\\n  list_ftp\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Ftp/list_ftp"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Ftp_list_ftp.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Ftp_list_ftp.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/Ftp/,\n    q/list_ftp/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Ftp_list_ftp.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Ftp_list_ftp.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    'Ftp',\n    'list_ftp'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Ftp","FTP Accounts"],"summary":"Return FTP accounts","x-cpanel-api-version":"UAPI","parameters":[{"required":"false","name":"skip_acct_types","in":"query","schema":{"example":"main|anonymous","type":"string"},"description":"A list of the FTP account types to exclude from the function's\nresults.\n\n* `anonymous`\n* `logaccess`\n* `main`\n* `sub`\n\nIf you do not specify this parameter, this function does **not** exclude\nany account types.\n\n**Note:**\n\n* Separate multiple types with the pipe character (`|`).\n* In browser-based calls, use `%7C`."},{"required":"false","name":"include_acct_types","in":"query","schema":{"example":"main|anonymous","type":"string"},"description":"A list of the FTP account types to include in the function's results.\n\n* `anonymous`\n* `logaccess`\n* `main`\n* `sub`\n\nIf you do not specify this parameter, this function returns all FTP account\ntypes.\n\n**Note:**\n\n* Separate multiple types with the pipe character (`|`).\n* In browser-based calls, use `%7C`."}],"description":"This function lists FTP account information.\n\n**Important:**\n\nWhen you disable the [*FTP* role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function. For more information, read our How to Use Server Profiles documentation.","operationId":"list_ftp","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"list_ftp","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"The type of FTP account.\n\n* `anonymous`\n* `logaccess`\n* `main`\n* `sub`","example":"main","enum":["anonymous","logaccess","main","sub"]},"user":{"type":"string","example":"ftpaccount","description":"The username for an FTP account on the cPanel account."},"homedir":{"example":"/home/user/public_html/ftp/","format":"path","description":"The absolute path to the FTP account's document root.","type":"string"}}}},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}}}},"module":{"type":"string","example":"Ftp","description":"The name of the module called."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"tags":[{"name":"Ftp","description":"The Ftp module for UAPI."},{"name":"FTP Accounts","description":"Files / FTP Accounts"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"}},"InProductSurvey":{"get_in_product_survey_url":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.97.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"Return in-product survey banner state and link.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"description":"The InProductSurvey module for cPanel UAPI.","name":"InProductSurvey"}],"servers":[{"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."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["InProductSurvey"],"name":"InProductSurvey"}],"paths":{"/InProductSurvey/get_in_product_survey_url":{"get":{"summary":"Return in-product survey banner data","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n--user=username \\\nInProductSurvey \\\nget_in_product_survey_url\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/InProductSurvey/get_in_product_survey_url\n"},{"lang":"Perl","label":"LiveAPI Perl","source":"use strict;\nuse Cpanel::LiveAPI ();\nmy $cpanel = Cpanel::LiveAPI->new();\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\nmy $response = $cpanel->uapi(\n    q/InProductSurvey/,\n    q/get_in_product_survey_url/,\n);\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$cpanel->end();\nsub to_json { require JSON; JSON->new->pretty->encode($_[0]) }\n"},{"source":"<?php\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\nheader('Content-Type: text/plain');\n$cpanel = new CPANEL();\n$response = $cpanel->uapi('InProductSurvey', 'get_in_product_survey_url');\nif ($response['cpanelresult']['result']['status']) {\n    $data = $response['cpanelresult']['result']['data'];\n    print json_encode($data, JSON_PRETTY_PRINT);\n} else {\n    print json_encode($response['cpanelresult']['result']['errors'], JSON_PRETTY_PRINT);\n}\n$cpanel->end();","label":"LiveAPI PHP","lang":"PHP"}],"tags":["InProductSurvey"],"x-cpanel-available-version":"11.32","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"type":"object","properties":{"submit_event":{"example":"survey_submitted","description":"Client-side analytics or event identifier emitted on successful survey submission.","type":"string"},"link":{"type":"string","example":"https://survey.example.tld/some/generated/link","description":"The fully resolved survey URL."},"max_dismiss":{"type":"string","example":"3","description":"Maximum number of dismissals allowed before the banner is suppressed."},"user_type":{"description":"Type of authenticated user context.","example":"cpanel","enum":["cpanel","webmail"],"type":"string"},"new_user":{"type":"string","description":"Whether the authenticated user is considered new.\n* `1` — New user experience.\n* `0` — Established user.","example":"0","enum":["1","0"]},"display":{"description":"Whether to display the in-product survey banner.\n* `1` — Display the banner.\n* `0` — Do not display the banner.","enum":["1","0"],"example":"1","type":"string"},"server_type":{"example":"cpanel","description":"Product/server type identifier (e.g., cpanel, whm).","type":"string"}},"example":{"user_type":"cpanel","max_dismiss":"3","submit_event":"survey_submitted","link":"https://survey.example.tld/some/generated/link","server_type":"cpanel","display":"1","new_user":"0"},"description":"The in-product survey banner data."},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}}}},"module":{"example":"InProductSurvey","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"get_in_product_survey_url","type":"string"}}}}}}},"description":"\nThis function returns whether the in-product survey banner should display for the current user and the survey link.\n\n**Notes:**\n\n* The function selects a link template based on whether the authenticated user is a webmail user or a cPanel/Team user.\n* A `display` value of `0` means you should not render the banner UI.","operationId":"get_in_product_survey_url","parameters":[]}}}}},"cPGreyList":{"disable_all_domains":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The cPGreyList module for UAPI.","name":"cPGreyList"},{"description":"Email / Spam Filtering (Greylisting)","name":"Spam Filtering (Greylisting)"}],"paths":{"/cPGreyList/disable_all_domains":{"get":{"description":"This function disables Greylisting on a cPanel account's domains.","operationId":"cPGreyList-disable_all_domains","parameters":[],"x-cpanel-available-version":"cPanel 11.50","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"disable_all_domains","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"cPGreyList"},"result":{"type":"object","properties":{"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"data":{"type":"array","items":{"properties":{"domain":{"example":"example.com","description":"The domain.","type":"string"},"type":{"description":"The domain type.\n- `main` — A main domain.\n- `addon` — An addon domain.\n- `parked` — A parked domain.","enum":["main","addon","parked"],"example":"main","type":"string"},"searchhint":{"type":"string","description":"A comma-separated list of domain-related search terms.","example":"this, that, the other"},"dependencies":{"description":"The domains that your changes will affect.","items":{"type":"string"},"example":["this.com","that.com","theother.com"],"type":"array"},"enabled":{"type":"integer","description":"Whether Greylisting is enabled.\n- `1` — Enabled.\n- `0` — Disabled.","enum":["0","1"],"example":"0"}},"type":"object"}},"status":{"type":"integer","description":"- 1 — Success.\n- 0 — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPGreyList \\\n  disable_all_domains\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/cPGreyList/disable_all_domains"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPGreyList_disable_all_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPGreyList_disable_all_domains.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/cPGreyList/,\n    q/disable_all_domains/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPGreyList_disable_all_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPGreyList_disable_all_domains.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    'cPGreyList',\n    'disable_all_domains'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["cPGreyList","Spam Filtering (Greylisting)"],"summary":"Disable Greylisting for all domains","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Email","tags":["Spam Filtering (Greylisting)"]}]},"disable_domains":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"tags":["Spam Filtering (Greylisting)"],"name":"Email"}],"paths":{"/cPGreyList/disable_domains":{"get":{"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPGreyList \\\n  disable_domains \\\n  domains='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/cPGreyList/disable_domains?domains=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPGreyList_disable_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPGreyList_disable_domains.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/cPGreyList/,\n    q/disable_domains/,\n    {\n        'domains' => 'example.com',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPGreyList_disable_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPGreyList_disable_domains.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    'cPGreyList',\n    'disable_domains',\n    array (\n        'domains' => 'example.com',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["cPGreyList","Spam Filtering (Greylisting)"],"summary":"Disable Greylisting for specified domains","x-cpanel-api-version":"UAPI","parameters":[{"schema":{"type":"string"},"description":"The domain on which to disable Greylisting.\n\n**Note:**\n\nTo disable Greylisting on multiple domains, use the `domains` parameter multiple times.","examples":{"multiple":{"value":"domain=example.com domain=example1.com domain=example2.com","description":"Multiple domains."},"single":{"value":"example.com","description":"A single domain."}},"required":"true","name":"domains","in":"query"}],"description":"This function disables Greylisting on a cPanel account's selected domains.","operationId":"cPGreyList-disable_domains","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"disable_domains","type":"string"},"result":{"properties":{"data":{"type":"array","items":{"type":"object","properties":{"dependencies":{"type":"array","description":"An array of domains that your changes will affect.","items":{"type":"string"},"example":["this.com","that.com","theother.com"]},"enabled":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether Greylisting is disabled.\n* `1` — Enabled.\n* `0` — Disabled."},"type":{"type":"string","example":"main","enum":["main","sub"],"description":"The domain type.\n* `main` — A main domain.\n* `sub` — A subdomain."},"domain":{"type":"string","example":"example.com","description":"The domain."},"searchhint":{"type":"string","description":"A comma-separated list of domain-related search terms.","example":"this, that, the other"}}}},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"cPGreyList","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.50"}}},"tags":[{"name":"cPGreyList","description":"The cPGreyList module for UAPI."},{"name":"Spam Filtering (Greylisting)","description":"Email / Spam Filtering (Greylisting)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}]},"has_greylisting_enabled":{"tags":[{"name":"cPGreyList","description":"The cPGreyList module for UAPI."},{"description":"Email / Spam Filtering (Greylisting)","name":"Spam Filtering (Greylisting)"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Spam Filtering (Greylisting)"]}],"paths":{"/cPGreyList/has_greylisting_enabled":{"get":{"parameters":[],"operationId":"has_greylisting_enabled","description":"This function checks whether Greylisting is enabled for the cPanel account.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"has_greylisting_enabled","description":"The name of the method called."},"module":{"type":"string","example":"cPGreyList","description":"The name of the module called."},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"enabled":{"description":"Whether Greylisting is enabled.\n* `1` — Enabled.\n* `0` — Disabled.","example":"0","enum":["0","1"],"type":"integer"}}},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}}}},"x-cpanel-available-version":"cPanel 11.50","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPGreyList \\\n  has_greylisting_enabled\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/cPGreyList/has_greylisting_enabled","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPGreyList_has_greylisting_enabled.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPGreyList_has_greylisting_enabled.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/cPGreyList/,\n    q/has_greylisting_enabled/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPGreyList_has_greylisting_enabled.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPGreyList_has_greylisting_enabled.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    'cPGreyList',\n    'has_greylisting_enabled'\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}"}],"tags":["cPGreyList","Spam Filtering (Greylisting)"],"summary":"Return whether Greylisting is enabled","x-cpanel-api-version":"UAPI"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"enable_all_domains":{"x-tagGroups":[{"name":"Email","tags":["Spam Filtering (Greylisting)"]}],"paths":{"/cPGreyList/enable_all_domains":{"get":{"tags":["cPGreyList","Spam Filtering (Greylisting)"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPGreyList \\\n  enable_all_domains\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/cPGreyList/enable_all_domains","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPGreyList_enable_all_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPGreyList_enable_all_domains.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/cPGreyList/,\n    q/enable_all_domains/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPGreyList_enable_all_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPGreyList_enable_all_domains.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    'cPGreyList',\n    'enable_all_domains'\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","summary":"Enable Greylisting for all domains","parameters":[],"description":"This function enables Greylisting on all of the cPanel account's domains.","operationId":"cPGreyList-enable_all_domains","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"enable_all_domains"},"module":{"description":"The name of the module called.","example":"cPGreyList","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"data":{"type":"array","items":{"properties":{"dependencies":{"description":"An array of domains that your changes will affect.","items":{"type":"string"},"example":["this.com","that.com","theother.com"],"type":"array"},"enabled":{"type":"integer","description":"Whether Greylisting is enabled.\n* `1` — Enabled.\n* `0` — Disabled.","example":"0","enum":["0","1"]},"domain":{"type":"string","example":"example.com","description":"The domain."},"type":{"type":"string","example":"main","description":"The domain type.\n* `main` — A main domain.\n* `sub` — A subdomain."},"searchhint":{"description":"A comma-separated list of domain-related search terms.","example":"this, that, and the other.","type":"string"}},"type":"object"}},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details."},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"}}}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.50"}}},"tags":[{"name":"cPGreyList","description":"The cPGreyList module for UAPI."},{"description":"Email / Spam Filtering (Greylisting)","name":"Spam Filtering (Greylisting)"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"enable_domains":{"x-tagGroups":[{"name":"Email","tags":["Spam Filtering (Greylisting)"]}],"paths":{"/cPGreyList/enable_domains":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPGreyList \\\n  enable_domains \\\n  domains='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/cPGreyList/enable_domains?domains=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPGreyList_enable_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPGreyList_enable_domains.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/cPGreyList/,\n    q/enable_domains/,\n    {\n        'domains' => 'example.com',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPGreyList_enable_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPGreyList_enable_domains.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    'cPGreyList',\n    'enable_domains',\n    array (\n        'domains' => 'example.com',\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["cPGreyList","Spam Filtering (Greylisting)"],"summary":"Enable Greylisting for specified domains","x-cpanel-api-version":"UAPI","description":"This function enables Greylisting on a cPanel account's selected domains.","operationId":"cPGreyList-enable_domains","parameters":[{"description":"The domain on which to enable Greylisting.\n\n**Note:**\n\n To enable Greylisting on multiple domains, use the `domains` parameter multiple times.","examples":{"single":{"value":"example.com","summary":"A single domain."},"multiple":{"value":"domain=example.com&domain=example1.com&domain=example2.com","summary":"Multiple domains."}},"schema":{"type":"string"},"in":"query","name":"domains","required":"true"}],"x-cpanel-available-version":"cPanel 11.50","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"type":{"description":"The domain type.\n* `main` — A main domain.\n* `sub` — A subdomain.","enum":["main","sub"],"example":"main","type":"string"},"searchhint":{"type":"string","description":"A comma-separated list of domain-related search terms.","example":"example, example1, example2"},"domain":{"example":"example.com","description":"The domain.","type":"string"},"dependencies":{"example":["example.com","example1.com","example2.com"],"items":{"type":"string","format":"domain"},"description":"An array of domains that your changes will affect.","type":"array"},"enabled":{"enum":["0","1"],"example":"0","description":"Whether Greylisting is disabled.\n* `1` — Enabled.\n* `0` — Disabled.","type":"integer"}}}},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"cPGreyList"},"func":{"example":"enable_domains","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"tags":[{"description":"The cPGreyList module for UAPI.","name":"cPGreyList"},{"name":"Spam Filtering (Greylisting)","description":"Email / Spam Filtering (Greylisting)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"list_domains":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/cPGreyList/list_domains":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return Greylisting status for domains","tags":["cPGreyList","Spam Filtering (Greylisting)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPGreyList \\\n  list_domains\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/cPGreyList/list_domains"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPGreyList_list_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPGreyList_list_domains.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/cPGreyList/,\n    q/list_domains/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPGreyList_list_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPGreyList_list_domains.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    'cPGreyList',\n    'list_domains'\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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"list_domains","description":"The name of the method called."},"module":{"example":"cPGreyList","description":"The name of the module called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"array","properties":{},"items":{"properties":{"enabled":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether Greylisting is enabled.\n* `1` — Enabled.\n* `0` — Disabled."},"searchhint":{"type":"string","description":"A comma-separated list of domain-related search terms.","example":"this, that, and the other."},"cPGreyList":{"description":"An object that contains the number of domains with Greylisting enabled or disabled.","type":"object","properties":{"total_disabled":{"type":"integer","minimum":"0","description":"The number of domains with Greylisting disabled.","example":"1"},"total_enabled":{"example":"0","description":"The number of domains with Greylisting enabled.","minimum":"0","type":"integer"}}},"dependencies":{"type":"array","example":["this.com","that.com","theother.com"],"description":"An array of domains that your changes to a selected domain will affect.","items":{"format":"domain","type":"string"}},"domain":{"example":"example.com","format":"domain","description":"The domain.","type":"string"},"type":{"description":"The domain type.\n* `main` — A main domain.\n* `sub` — A subdomain.","enum":["main","sub"],"example":"main","type":"string"}},"type":"object"}},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}},"type":"object"}}}}}}},"x-cpanel-available-version":"cPanel 11.50","parameters":[],"description":"This function returns Greylisting's status for a cPanel account's domains.","operationId":"cPGreyList::list_domains"}}},"x-tagGroups":[{"name":"Email","tags":["Spam Filtering (Greylisting)"]}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The cPGreyList module for UAPI.","name":"cPGreyList"},{"name":"Spam Filtering (Greylisting)","description":"Email / Spam Filtering (Greylisting)"}]}},"WordPressInstanceManager":{"start_scan":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"name":"WordPressInstanceManager","description":"The WordPressInstanceManager module for UAPI."},{"name":"WordPress Manager Settings","description":"Optional Applications / WordPress Manager Settings"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Settings"]}],"paths":{"/WordPressInstanceManager/start_scan":{"get":{"x-cpanel-api-version":"UAPI","summary":"Start WordPress sites scan","tags":["WordPressInstanceManager","WordPress Manager Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  start_scan\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/start_scan","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_start_scan.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_start_scan.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/WordPressInstanceManager/,\n    q/start_scan/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_start_scan.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_start_scan.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    'WordPressInstanceManager',\n    'start_scan'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"WordPressInstanceManager"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"data":{"type":"object","properties":{"log":{"format":"path","description":"The absolute path to the log file for the scan.","example":"/home/example/.cpanel/plugins/wordpress/scans/B3A27B96-51F7-11E8-92E3-CC90C4F823F0","type":"string"},"guid":{"description":"The unique identifier for the scan. A valid string.","example":"B3A27B96-51F7-11E8-92E3-CC90C4F823F0","type":"string"},"sse_url":{"type":"string","example":"/sse/WordPressScan/B3A27B96-51F7-11E8-92E3-CC90C4F823F0","format":"url-path","description":"The SSE interface that other applications can use to track the progress of the scan.\n\n**Note:**\n\nFor more information about the SSE interface, read the [Server Sent Events](#server-sent-events-sse) section."}}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"description":"- `1` - Success\n- `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{}}}},"func":{"type":"string","description":"The name of the method called.","example":"start_scan"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"WordPress Instance Manager 2.0","parameters":[],"description":"This function scans for WordPress® instances installed on a cPanel account. The system will populate cPanel's WordPress Manager interface with any newly discovered instances.\n\n**Note:**\n\nYou **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.\n\n### Server Sent Events (SSE)\n\nThis function uses the following SSE events:\n\n* `register` — The scan operation discovered a WordPress instance and registered it. The data is a\nJSON-encoded object containing the attributes of the instance, with the same format used in the\nUAPI `get_instances` and UAPI `get_instance_by_id` functions.\n* `found` — The scan operation found a WordPress instance. If the WordPress instance is newly\ndiscovered, the system will also generate a `register` event for the instance. The data is a\nJSON-encoded object containing the following:\n  * `path` — The absolute file path to the instance.\n* `done` — The scan is finished. The data is a JSON-encoded object that contains:\n  * `found` — An array of strings that represents the absolute path to the discovered instances and\n  any instances that the system already registered.\n  * `converted` — An array of converted instances that the system returns in the same format\n  provided in the UAPI `get_instances` and UAPI `get_instance_by_id` functions.\n* `terminated` — The system or user terminated the scan.\t\n* `timedout` — The scan timed out before it completed.\n* `register-failed` — The system failed to build the instance registry.\tThe data is a JSON-encoded\nstring that contains the error message.\n* `register-load-failed` — The system could not load the registry after building the instance\nregistry. The data is a JSON-encoded string that contains the error message.\n\nFor more information about server sent events, read Mozilla's [Using server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) documentation.","operationId":"WordPressInstanceManager-start_scan"}}}},"get_scan_results":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Settings"]}],"paths":{"/WordPressInstanceManager/get_scan_results":{"get":{"description":"This function checks the status of a completed scan and reports the results. To find more information about the scan process, read our UAPI documentation for `WordPressInstanceManager::start_scan`.\n\n**Note:**\n\n  You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"get_scan_results","parameters":[],"x-cpanel-available-version":"WordPress Instance Manager 2.0","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_scan_results","description":"The name of the method called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"instances":{"description":"An array of objects that contains the WordPress instance information.","items":{"type":"object","properties":{"db_username":{"description":"The WordPress instance's database username.","example":"example_wp","type":"string"},"db_server":{"description":"The WordPress instance's database server hostname.","example":"localhost","type":"string"},"db_prefix":{"description":"The WordPress instance's database prefix.","example":"wp","type":"string"},"domain":{"type":"string","description":"The WordPress instance's domain.","format":"domain","example":"example.com"},"rel_path":{"description":"The WordPress instance's installation path relative to the domain's document root.","format":"path","example":"public_html","type":"string"},"current_version":{"type":"string","example":"4.9.5","description":"The WordPress instance's installed version."},"id":{"type":"string","example":"cPanel__Blogs__WordPressX.0.1528208546","description":"The WordPress instance's unique identifier."},"available_version":{"example":"4.9.5","description":"The latest Wordpress's version.","type":"string"},"addon_type":{"type":"string","enum":["modern","legacy","unmanaged"],"example":"modern","description":"The WordPress instance's installation method.\n* `modern` — Installed by RPM-managed WordPress cPAddon.\n* `legacy` — Installed by legacy cPAddon.\n* `unmanaged` — Installed by third-party tool or the WordPress installer."},"initial_install_version":{"description":"The WordPress instance's version number at installation.","example":"4.9.6","type":"string"},"admin_url":{"type":"string","description":"The URL to the instance's administration interface.","format":"url-path","example":"example.com/wp-login.php"},"admin_username":{"type":"string","description":"The administrator username the installer created at the time of installation.","example":"admin"},"addon_name":{"type":"string","description":"The WordPress cPAddon that installed the instance.\n* `cPanel::Blogs::WordPress`\n* `cPanel::Blogs::WordPressX`\n* `cPanel::Blogs::WordPressUnmanaged`","enum":["cPanel::Blogs::WordPress","cPanel::Blogs::WordPressX","cPanel::Blogs::WordPressUnmanaged"],"example":"cPanel::Blogs::WordPressX"},"full_path":{"example":"/home/example/public_html","description":"The WordPress instance's full installation path.","format":"path","type":"string"},"db_type":{"type":"string","description":"The WordPress instance's database type.\n* `mysql`\n* `postgres`","example":"mysql","enum":["mysql","postgres"]},"addon_config":{"type":"string","example":"/home/example/.cpaddons/cPanel::Blogs::WordPressX.0.yaml","description":"The WordPress instance's configuration file location."},"db_name":{"type":"string","example":"example_wp","description":"The WordPress instance's database name."},"site_url":{"type":"string","format":"url-path","description":"The WordPress instance's home page URL.","example":"example.com"},"homedir":{"type":"string","example":"/home/example","format":"path","description":"The cPanel account's home directory."}}},"type":"array"},"is_running":{"description":"Whether the system detects an active scan.\n\n* `1` - A scan is active.\n* `0` - No scans are active.","example":"1","enum":["0","1"],"type":"integer"}}},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"WordPressInstanceManager","description":"The name of the module called."}}}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  get_scan_results\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/get_scan_results"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_get_scan_results.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_scan_results.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/WordPressInstanceManager/,\n    q/get_scan_results/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_get_scan_results.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_scan_results.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    'WordPressInstanceManager',\n    'get_scan_results'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"],"summary":"Return WordPress site scan results","x-cpanel-api-version":"UAPI"}}},"tags":[{"name":"WordPressInstanceManager","description":"The WordPressInstanceManager module for UAPI."},{"description":"Optional Applications / WordPress Manager Settings","name":"WordPress Manager Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"get_instance_by_id":{"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/WordPressInstanceManager/get_instance_by_id":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"WordPressInstanceManager","description":"The name of the module called."},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"site_url":{"type":"string","description":"The WordPress instance's home page URL.","format":"url-path","example":"example.com/wordpress"},"db_name":{"type":"string","description":"A database name.","example":"example_wp2"},"full_path":{"type":"string","example":"/home/example/public_html","description":"The WordPress instance's full installation absolute filepath.","format":"path"},"db_type":{"type":"string","description":"The WordPress instance's database type.","example":"mysql","enum":["mysql"]},"autoupdate.core.major":{"type":"boolean","description":"Whether the user enabled automatic updates for major releases.\n* `true` — Enabled.\n* `false` — Disabled.","example":"false"},"admin_username":{"type":"string","example":"admin","description":"The administrator username configured at the time of installation."},"addon_name":{"description":"The WordPress cPAddon used to install the instance.\n* `cPanel::Blogs::WordPress`\n* `cPanel::Blogs::WordPressX`\n* `cPanel::Blogs::WordPressUnmanaged`","example":"cPanel::Blogs::WordPressX","enum":["cPanel::Blogs::WordPress","cPanel::Blogs::WordPressX","cPanel::Blogs::WordPressUnmanaged"],"type":"string"},"rel_path":{"type":"string","example":" ","description":"The WordPress instance's installation path, relative to the damin's document root.\n\n**Note:**\n\nThis function returns an empty value if the relative path is the document root.","format":"path"},"recent":{"type":"integer","description":"Whether the system added the WordPress instance in the last 24 hours.\n* `1` — Added recently.\n* `0` — Added previously.","example":"1","enum":["0","1"]},"domain":{"type":"string","format":"domain","description":"The WordPress instance's installation domain.","example":"example.com"},"db_username":{"type":"string","description":"The WordPress instance's database username.","example":"example_wp"},"admins":{"description":"A list of the WordPress instance's administrators.","items":{"properties":{"display_name":{"example":"admin","description":"The user's display name.","type":"string"},"user_login":{"example":"admin","description":"The user's login name.","type":"string"},"user_nicename":{"example":"admin","description":"The user's simplified username, which you can use as an HTML ID or similar.","type":"string"},"ID":{"type":"integer","minimum":"1","example":"1","description":"The user's automatically generated identifier."},"user_email":{"type":"string","description":"The user's email address.","format":"email","example":"admin@example.com"},"user_status":{"description":"The user's verified status.\n* `1` — Verified.\n* `0` — Unverified.","enum":["0","1"],"example":"0","type":"integer"}},"type":"object"},"type":"array"},"autoupdate.core.minor":{"type":"boolean","example":"true","description":"Whether the user enabled automatic updates for minor releases.\n* `true` — Enabled.\n* `false` — Disabled."},"created_on":{"example":"1528208546","description":"The WordPress instance's installation date.","format":"unix_timestamp","type":"integer"},"homedir":{"example":"/home/example","description":"The cPanel account's home directory.","format":"path","type":"string"},"addon_config":{"type":"string","format":"path","description":"The WordPress instance's configureation absolute file path location.","example":"/home/example/.cpaddons/cPanel::Blogs::WordPressX.0.yaml"},"id":{"description":"The WordPress instance's unique identifier.","example":"cPanel__Blogs__WordPressX.0.1528208546","type":"string"},"available_version":{"type":"string","description":"The lastest WordPress instance's version.","example":"4.9.6"},"autoupdate":{"description":"Whether the user enabled automatic updates.\n* `true` — Enabled.\n* `false` — Disabled.","example":"true","type":"boolean"},"addon_type":{"type":"string","description":"The WordPress instance's installation method.\n* `modern` — Installed by RPM-managed WordPress cPAddon.\n* `legacy` — Installed by legacy cPAddon.\n* `unmanaged` — Installed by third-party tool or the WordPress installer.","enum":["modern","legacy","unmanaged"],"example":"modern"},"admin_url":{"format":"url-path","description":"The URL to the instance's administration interface.","example":"example.com/wp-login.php","type":"string"},"initial_install_version":{"type":"string","example":"4.7.2","description":"The WordPress instance's version at installation."},"current_version":{"type":"string","description":"The WordPress instance's version.","example":"4.9.5"},"db_server":{"example":"localhost","description":"The WordPress instance's database server hostname.","type":"string"},"db_prefix":{"type":"string","description":"A database table prefix.","example":"wp"},"autoupdate.core.has_filter":{"description":"Whether one of more filters modify the core autoupdate settings.\n* `true` — Filter(s) applied.\n* `false` — No filters applied.\n\n**Note**\n\nTypically, plugins apply filters to the autoupdate settings.","example":"false","type":"boolean"}}},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details."},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"type":"string","example":"get_instance_by_id","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"WordPress Instance Manager 1.0","parameters":[{"name":"id","in":"query","required":"true","description":"The WordPress instance's unique ID.\n\n**Note:**\n\n You can retrieve an instance ID with the `get_instances` function.","schema":{"type":"string","example":"cPanel__Blogs__WordPressX.0.1528208546"}}],"description":"This function retrieves a WordPress® instance's configuration.\n\n**Note:**\n\n* You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.\n* This function retrieves some data that the system stored during the WordPress installation. That data may not reflect the most recent user changes.","operationId":"get_instance_by_id","summary":"Return WordPress site settings","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  get_instance_by_id \\\n  id='cPanel__Blogs__WordPressX.0.1528208546'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/get_instance_by_id?id=cPanel__Blogs__WordPressX.0.1528208546","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_get_instance_by_id.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_instance_by_id.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/WordPressInstanceManager/,\n    q/get_instance_by_id/,\n    {\n        'id' => 'cPanel__Blogs__WordPressX.0.1528208546',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_get_instance_by_id.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_instance_by_id.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    'WordPressInstanceManager',\n    'get_instance_by_id',\n    array (\n        'id' => 'cPanel__Blogs__WordPressX.0.1528208546',\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}"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"]}}},"x-tagGroups":[{"tags":["WordPress Manager Settings"],"name":"Optional Applications"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The WordPressInstanceManager module for UAPI.","name":"WordPressInstanceManager"},{"description":"Optional Applications / WordPress Manager Settings","name":"WordPress Manager Settings"}]},"is_installable_addon_available":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Settings"]}],"paths":{"/WordPressInstanceManager/is_installable_addon_available":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  is_installable_addon_available\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/is_installable_addon_available"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_is_installable_addon_available.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_is_installable_addon_available.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/WordPressInstanceManager/,\n    q/is_installable_addon_available/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_is_installable_addon_available.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_is_installable_addon_available.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    'WordPressInstanceManager',\n    'is_installable_addon_available'\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}"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"],"summary":"Verify WordPress cPAddon availability","x-cpanel-api-version":"UAPI","parameters":[],"description":"This function verifies that the RPM-based WordPress® cPAddon exists on the system.\n\n**Note:**\n\n  You must install the WordPress Manager cPanel plugin to access this API function.","operationId":"is_installable_addon_available","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"data":{"example":"1","enum":["0","1"],"description":"Whether the RPM-based WordPress cPAddon exists on the server.\n* `1` - Exists.\n* `0` - Does **not** exist.","type":"integer"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null}},"type":"object"},"module":{"description":"The name of the module called.","example":"WordPressInstanceManager","type":"string"},"func":{"example":"is_installable_addon_available","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"WordPress Instance Manager 1.1.1"}}},"tags":[{"name":"WordPressInstanceManager","description":"The WordPressInstanceManager module for UAPI."},{"name":"WordPress Manager Settings","description":"Optional Applications / WordPress Manager Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}]},"change_admin_password":{"paths":{"/WordPressInstanceManager/change_admin_password":{"get":{"summary":"Update WordPress site admin password","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  change_admin_password \\\n  id='cPanel__Blogs__WordPressX.0.1491917088' \\\n  password='luggage12345'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/change_admin_password?id=cPanel__Blogs__WordPressX.0.1491917088&password=luggage12345"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_change_admin_password.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_change_admin_password.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/WordPressInstanceManager/,\n    q/change_admin_password/,\n    {\n        'id' => 'cPanel__Blogs__WordPressX.0.1491917088',\n        'password' => 'luggage12345',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_change_admin_password.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_change_admin_password.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    'WordPressInstanceManager',\n    'change_admin_password',\n    array (\n        'id' => 'cPanel__Blogs__WordPressX.0.1491917088',\n        'password' => 'luggage12345',\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}"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"],"x-cpanel-available-version":"WordPress Instance Manager 1.0","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"change_admin_password","type":"string"},"module":{"type":"string","example":"WordPressInstanceManager","description":"The name of the module called."},"result":{"properties":{"metadata":{"properties":{}},"data":{"default":null,"nullable":"true","type":"object"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function updates a WordPress® cPAddon instance's administrator password.\n\n**Note:**\n\n  You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"change_admin_password","parameters":[{"schema":{"type":"string","example":"cPanel__Blogs__WordPressX.0.1491917088"},"description":"The cPAddon instance's unique ID.\n\n**Note:**\n\n You can retrieve an instance ID with the `get_instances` function.","required":"true","in":"query","name":"id"},{"schema":{"type":"string","example":"luggage12345"},"description":"The cPAddon instance's new administrator password.","required":"true","name":"password","in":"query"}]}}},"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Settings"]}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"WordPressInstanceManager","description":"The WordPressInstanceManager module for UAPI."},{"name":"WordPress Manager Settings","description":"Optional Applications / WordPress Manager Settings"}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"get_latest_wordpress_version_from_wordpress_org":{"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"description":"The WordPressInstanceManager module for UAPI.","name":"WordPressInstanceManager"},{"name":"WordPress Manager Settings","description":"Optional Applications / WordPress Manager Settings"}],"paths":{"/WordPressInstanceManager/get_latest_wordpress_version_from_wordpress_org":{"get":{"description":"This function returns the available WordPress® updates from wordpress.org.\n\n**Note:**\n\n  You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"get_latest_wordpress_version_from_wordpress_org","parameters":[{"required":"false","name":"force","in":"query","schema":{"type":"integer","default":"0","example":"0","enum":["0","1"]},"description":"Whether to force a reload from the remote API. Otherwise, the\nfunction returns information stored in local cache.\n* `1` — Force reload\n* `0` — Read local cashe."},{"required":"false","name":"cache_time","in":"query","schema":{"default":"86400","example":"3600","type":"integer","minimum":"0"},"description":"The length of time in seconds to cache the database between requests to wordpress.org."}],"x-cpanel-available-version":"Word Press Instance Manager 1.0","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_latest_wordpress_version_from_wordpress_org"},"module":{"type":"string","example":"WordPressInstanceManager","description":"The name of the module called."},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"data":{"type":"object","properties":{"translations":{"items":{"type":"string"},"type":"array"},"offers":{"type":"array","items":{"type":"object","properties":{"response":{},"partial_version":{},"packages":{"type":"object","properties":{"full":{},"partial":{},"no_content":{},"rollback":{},"new_bundled":{}}},"php_version":{},"download":{},"version":{},"mysql_version":{},"locale":{},"new_bundled":{},"current":{}}},"description":"This array contains the returned value from [wordpress.org's](https://wordpress.org/) Version Check API.\n\n**Note:**\n\n For additional information about the returned values, read [WordPress's Version Check API](https://codex.wordpress.org/WordPress.org_API) documentation."}}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  get_latest_wordpress_version_from_wordpress_org\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/get_latest_wordpress_version_from_wordpress_org","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_get_latest_wordpress_version_from_wordpress_org.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_latest_wordpress_version_from_wordpress_org.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/WordPressInstanceManager/,\n    q/get_latest_wordpress_version_from_wordpress_org/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_get_latest_wordpress_version_from_wordpress_org.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_latest_wordpress_version_from_wordpress_org.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    'WordPressInstanceManager',\n    'get_latest_wordpress_version_from_wordpress_org'\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}"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"],"summary":"Return latest wordpress.org updates","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Settings"]}]},"get_api_version":{"paths":{"/WordPressInstanceManager/get_api_version":{"get":{"summary":"Return WordPress Manager plugin version","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  get_api_version\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/get_api_version","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_get_api_version.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_api_version.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/WordPressInstanceManager/,\n    q/get_api_version/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_get_api_version.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_api_version.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    'WordPressInstanceManager',\n    'get_api_version'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"data":{"properties":{"version":{"type":"string","example":"1.0.1-0","description":"The WordPress Manager plugin’s version."}},"type":"object"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"description":"The name of the module called.","example":"WordPressInstanceManager","type":"string"},"func":{"example":"get_api_version","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"WordPress Instance Manager 1.1","parameters":[],"operationId":"get_api_version","description":"This function retrieves the WordPress Manager plugin's version.\n\n**Note:**\n\n  You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function."}}},"x-tagGroups":[{"tags":["WordPress Manager Settings"],"name":"Optional Applications"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"WordPressInstanceManager","description":"The WordPressInstanceManager module for UAPI."},{"name":"WordPress Manager Settings","description":"Optional Applications / WordPress Manager Settings"}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"configure_autoupdate":{"tags":[{"name":"WordPressInstanceManager","description":"The WordPressInstanceManager module for UAPI."},{"name":"WordPress Manager Settings","description":"Optional Applications / WordPress Manager Settings"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Settings"]}],"paths":{"/WordPressInstanceManager/configure_autoupdate":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  configure_autoupdate \\\n  id='cPanel__Blogs__WordPressX.0.1491917088' \\\n  autoupdate.core.major='0' \\\n  autoupdate.core.minor='0'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/configure_autoupdate?id=cPanel__Blogs__WordPressX.0.1491917088&autoupdate.core.major=0&autoupdate.core.minor=0","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_configure_autoupdate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_configure_autoupdate.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/WordPressInstanceManager/,\n    q/configure_autoupdate/,\n    {\n        'id' => 'cPanel__Blogs__WordPressX.0.1491917088',\n        'autoupdate.core.major' => '0',\n        'autoupdate.core.minor' => '0',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_configure_autoupdate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_configure_autoupdate.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    'WordPressInstanceManager',\n    'configure_autoupdate',\n    array (\n        'id' => 'cPanel__Blogs__WordPressX.0.1491917088',\n        'autoupdate.core.major' => '0',\n        'autoupdate.core.minor' => '0',\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}"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"],"summary":"Update WordPress site automatic update settings","x-cpanel-api-version":"UAPI","parameters":[{"in":"query","name":"id","required":"true","description":"The cPAddon instance's unique ID.\n\n**Note:**\n\n You can retrieve an instance ID with the `get_instances` function.","schema":{"example":"cPanel__Blogs__WordPressX.0.1491917088","type":"string"}},{"schema":{"type":"integer","example":"0","enum":["0","1"]},"description":"Whether to enable automatic updates for major releases.\n* `1` - Enable.\n* `0` - Disable.","required":"true","in":"query","name":"autoupdate.core.major"},{"required":"true","name":"autoupdate.core.minor","in":"query","schema":{"type":"integer","enum":["0","1"],"example":"0"},"description":"Whether to enable automatic updates for minor releases.\n* `1` - Enable.\n* `0` - Disable."}],"operationId":"configure_autoupdate","description":"This function configures a WordPress cPAddon instance's automatic updates settings. If you enable automatic updates for a legacy WordPress cPAddon instance, the function will convert it to use the RPM-based WordPress cPAddon.\n\n**Important:**\n\n  This function changes the instance's automatic update setting in the `wp-config.php` file. Before you run this function, you should verify that a filter does **not** exist for the automatic update settings. Use the `get_instance_by_id` function and view the `autoupdate.core.has_filter` return to determine if a filter exists.\n\n**Note:**\n\n  You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"WordPressInstanceManager","description":"The name of the module called."},"result":{"properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"properties":{"before":{"properties":{"db_name":{"type":"string","example":"example_wp1","description":"The instance's database name."},"site_url":{"description":"The instance's URL.","format":"url-path","example":"example.com/wordpress-41","type":"string"},"homedir":{"type":"string","example":"/home/example","format":"path","description":"The cPanel account's home directory."},"admin_username":{"type":"string","example":"wpadmin","description":"The instance's administrator username."},"addon_name":{"type":"string","example":"cPanel::Blogs::WordPress","description":"The instance's cPAddon name."},"full_path":{"example":"/home/example/public_html/wordpress-41","description":"The instance's full installation path.","format":"path","type":"string"},"db_type":{"type":"string","description":"The instance's database type.","example":"mysql"},"addon_config":{"format":"path","description":"The WordPress instance's configuration file location.","example":"/home/example/.cpaddons/cPanel::Blogs::WordPressX.0.yaml","type":"string"},"rel_path":{"format":"path","description":"The relative file path to the instance's document root.","example":"wordpress-41","type":"string"},"current_version":{"example":"4.9.1","description":"The WordPress instance's installed version.","type":"string"},"available_version":{"description":"The latest WordPress version.","example":"4.9.1","type":"string"},"id":{"example":"cPanel__Blogs__WordPress.1.1509732223","description":"The instance's unique ID.","type":"string"},"addon_type":{"description":"The instance's cPAddon type.\n\n**Note:**\n\n`legacy` is this only possible value.","example":"legacy","enum":["legacy"],"type":"string"},"initial_install_version":{"type":"string","example":"4.1","description":"The instance's original installation version."},"admin_url":{"type":"string","example":"example.com/wordpress-41/wp-login.php","format":"url-path","description":"The instance's administrator login URL."},"db_username":{"type":"string","example":"example_wp1","description":"The instance's database username."},"db_server":{"type":"string","description":"The instance's database server network path.","example":"localhost"},"db_prefix":{"type":"string","example":"example","description":"The instance's database prefix."},"domain":{"format":"domain","description":"The instance's domain name.","example":"example.com","type":"string"}},"type":"object","description":"A object that contains the instance's information before conversion."},"after":{"type":"object","properties":{"domain":{"example":"example.com","description":"The converted instance's domain name.","format":"domain","type":"string"},"db_prefix":{"example":"example","description":"The converted instance's database prefix.","type":"string"},"db_server":{"example":"localhost","description":"The converted instance's database server network path.","type":"string"},"db_username":{"type":"string","example":"example_wp1","description":"The converted instance's database username."},"migrated_from":{"type":"string","example":"cPanel::Blogs::WordPress","description":"The instance's original installation cPAddon name."},"admin_url":{"description":"The converted instance's administrator login URL.","format":"url-path","example":"example.com/wordpress-41/wp-login.php","type":"string"},"initial_install_version":{"description":"The instance's original installation version.","example":"4.1","type":"string"},"id":{"example":"cPanel__Blogs__WordPress.1.1509732223","description":"The converted instance's unique ID.","type":"string"},"available_version":{"description":"The latest WordPress version.","example":"4.9.1","type":"string"},"addon_type":{"type":"string","description":"The converted instance's cPAddon type.\n\n**Note:**\n\n`modern` is the only possible value.","enum":["modern"],"example":"modern"},"rel_path":{"example":"wordpress-41","description":"The relative file path to the converted instance's document root.","format":"path","type":"string"},"current_version":{"description":"The WordPress instance's installed version.","example":"4.9.1","type":"string"},"db_type":{"example":"mysql","description":"The converted instance's database type.","type":"string"},"addon_config":{"type":"string","example":"/home/example/.cpaddons/cPanel::Blogs::WordPressX.0.yaml","format":"path","description":"The WordPress instance's configuration file location."},"migrated_on":{"format":"unix_timestamp","description":"The time the system converted the instance.","example":"1513965986","type":"integer"},"full_path":{"type":"string","example":"/home/example/public_html/wordpress-41","format":"path","description":"The instance's full installation path."},"addon_name":{"example":"cPanel::Blogs::WordPressX","enum":["cPanel::Blogs::WordPressX"],"description":"The converted instance's cPAddon name.\n\n**Note:**\n\n`cPanel::Blogs::WordPressX` is the only possible value.","type":"string"},"admin_username":{"example":"wpadmin","description":"The instance's administrator username.","type":"string"},"homedir":{"example":"/home/example","description":"The cPanel account's home directory.","format":"path","type":"string"},"site_url":{"description":"The converted instance's URL.","format":"url-path","example":"example.com/wordpress-41","type":"string"},"db_name":{"type":"string","description":"The converted instance's database name.","example":"example_wp1"}},"description":"An object that contains the instance's information after conversion."}},"type":"object"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"example":"configure_autoupdate","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"WordPress Instance Manager 1.1"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"cleanup_scan":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The WordPressInstanceManager module for UAPI.","name":"WordPressInstanceManager"},{"description":"Optional Applications / WordPress Manager Settings","name":"WordPress Manager Settings"}],"paths":{"/WordPressInstanceManager/cleanup_scan":{"get":{"x-cpanel-available-version":"WordPress Instance Manager 2.0","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"cleanup_scan","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"}}},"module":{"description":"The name of the module called.","example":"WordPressInstanceManager","type":"string"}}}}},"description":"HTTP Request was successful."}},"operationId":"cleanup_scan","description":"This function cleans up the scan log file after you complete a scan with the WordPressInstanceManager::start_scan function. To read more information about the complete scan process, read our UAPI Functions - WordPressInstanceManager::start_scan documentation.\n\n**Note:**\n\n  You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","parameters":[{"schema":{"example":"B3A27B96-51F7-11E8-92E3-CC90C4F823F0","type":"string"},"description":"The scan’s unique ID.","required":"true","name":"guid","in":"query"}],"summary":"Remove scan log after completed scan","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  cleanup_scan \\\n  guid='B3A27B96-51F7-11E8-92E3-CC90C4F823F0'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/cleanup_scan?guid=B3A27B96-51F7-11E8-92E3-CC90C4F823F0"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_cleanup_scan.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_cleanup_scan.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/WordPressInstanceManager/,\n    q/cleanup_scan/,\n    {\n        'guid' => 'B3A27B96-51F7-11E8-92E3-CC90C4F823F0',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_cleanup_scan.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_cleanup_scan.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    'WordPressInstanceManager',\n    'cleanup_scan',\n    array (\n        'guid' => 'B3A27B96-51F7-11E8-92E3-CC90C4F823F0',\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}"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"]}}},"x-tagGroups":[{"tags":["WordPress Manager Settings"],"name":"Optional Applications"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"get_instances":{"tags":[{"name":"WordPressInstanceManager","description":"The WordPressInstanceManager module for UAPI."},{"name":"WordPress Manager Settings","description":"Optional Applications / WordPress Manager Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["WordPress Manager Settings"],"name":"Optional Applications"}],"paths":{"/WordPressInstanceManager/get_instances":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return WordPress sites","tags":["WordPressInstanceManager","WordPress Manager Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  get_instances\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/get_instances","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_get_instances.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_instances.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/WordPressInstanceManager/,\n    q/get_instances/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_get_instances.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_get_instances.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    'WordPressInstanceManager',\n    'get_instances'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"get_instances","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"data":{"type":"object","properties":{"instances":{"type":"array","description":"This array of objects contains the WordPress instance information.","items":{"properties":{"migrated_on":{"type":"integer","format":"unix_timestamp","description":"The timestamp when the system migrated the instance from legacy to modern WordPress cPAddon.","example":"1528209264"},"addon_config":{"type":"string","format":"path","description":"The WordPress instance's configuration file location.","example":"/home/example/.cpaddons/cPanel::Blogs::WordPressX.0.yaml"},"homedir":{"example":"/home/example","format":"path","description":"The cPanel account's home directory.","type":"string"},"imported_on":{"type":"integer","format":"unix_timestamp","description":"The WordPress instance's import date.","example":"1528209264"},"created_on":{"type":"integer","description":"The WordPress instance's installation date.","format":"unix_timestamp","example":"1528208546"},"import_guid":{"type":"string","example":"8AF1767E-68CD-11E8-90D1-96B06D626D05","description":"The imported WordPress instance's unique identifier."},"migrated_from":{"type":"string","description":"The cPAddon that the system migrated the instance from.","example":"cPanel::Blogs::WordPress"},"db_server":{"type":"string","example":"localhost","description":"The WordPress instance's database server hostname."},"db_prefix":{"type":"string","example":"wp","description":"The WordPress instance's database prefix."},"addon_type":{"type":"string","description":"The WordPress instance's installation method.\n* `modern` — Installed by RPM-managed WordPress cPAddon.\n* `legacy` — Installed by legacy cPAddon.\n* `unmanaged` — Installed by third-party tool or the WordPress installer.","enum":["modern","legacy","unmanaged"],"example":"modern"},"available_version":{"type":"string","nullable":"true","example":null,"description":"This return is unused."},"id":{"example":"cPanel__Blogs__WordPressX.0.1528208546","description":"The WordPress instance's unique identifier.","type":"string"},"admin_url":{"type":"string","example":"example.com/wp-login.php","format":"url-path","description":"The URL to the instance's administration interface."},"initial_install_version":{"type":"string","example":"4.9.6","description":"The WordPress instance's version number at installation."},"current_version":{"type":"string","example":null,"description":"This return is unused.","nullable":"true"},"full_path":{"format":"path","description":"The WordPress instance's full installation path.","example":"/home/example/public_html","type":"string"},"db_type":{"type":"string","enum":["mysql"],"example":"mysql","description":"The WordPress instance's database type.\n\n**Note**\n`mysql` is the only possible value."},"admin_username":{"type":"string","example":"admin","description":"The administrator username the installer created at the time of installation."},"addon_name":{"enum":["cPanel::Blogs::WordPress","cPanel::Blogs::WordPressX","cPanel::Blogs::WordPressUnmanaged"],"example":"cPanel::Blogs::WordPressX","description":"The WordPress cPAddon that installed the instance.\n* `cPanel::Blogs::WordPress`\n* `cPanel::Blogs::WordPressX`\n* `cPanel::Blogs::WordPressUnmanaged`","type":"string"},"site_url":{"format":"url-path","description":"The WordPress instance's home page URL.","example":"example.com","type":"string"},"db_name":{"description":"The WordPress instance's database name.","example":"example_wp","type":"string"},"domain":{"example":"example.com","format":"domain","description":"The WordPress instance's domain.","type":"string"},"db_username":{"type":"string","description":"The WordPress instance's database username.","example":"example_wp"},"recent":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the system added the WordPress instance in the last 24 hours.\n* `1` — Added recently.\n* `0` — Added previously."},"rel_path":{"format":"path","description":"The WordPress instance's installation path.\n\n**Note**\nThis function returns an empty value if the relative path is the document root.","example":" ","type":"string"}},"type":"object"}},"errors":{"type":"array","description":"This array contains the errors that the system experienced while it retrieved the instances.","items":{"type":"string"}}}},"status":{"example":"1","enum":["0","1"],"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"WordPressInstanceManager","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"WordPress Instance Manager 1.0","parameters":[],"description":"This function lists an account's WordPress® instances.\n\n**Note:**\n\n* You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.\n* This function retrieves data that the system stored during the WordPress installation. That data may not reflect the most recent user changes.","operationId":"get_instances"}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"cancel_scan":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"name":"WordPressInstanceManager","description":"The WordPressInstanceManager module for UAPI."},{"description":"Optional Applications / WordPress Manager Settings","name":"WordPress Manager Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Settings"]}],"paths":{"/WordPressInstanceManager/cancel_scan":{"get":{"summary":"Stop WordPress site scan","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressInstanceManager \\\n  cancel_scan\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/cancel_scan"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressInstanceManager_cancel_scan.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_cancel_scan.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/WordPressInstanceManager/,\n    q/cancel_scan/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressInstanceManager_cancel_scan.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressInstanceManager_cancel_scan.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    'WordPressInstanceManager',\n    'cancel_scan'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["WordPressInstanceManager","WordPress Manager Settings"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"WordPressInstanceManager","description":"The name of the module called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"data":{"type":"integer","description":"Whether the system cancelled the scan.\n\n* `1` - Cancelled.\n* `0` - **Not** cancelled.","enum":["0","1"],"example":"0"},"metadata":{"properties":{}},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}}},"func":{"example":"cancel_scan","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"WordPress Instance Manager 2.0","parameters":[],"description":"This function cancels a scan that you start with the `WordPressInstanceManager::start_scan` function.\n\n**Note:**\n\n  You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"cancel_scan"}}}}},"Quota":{"get_local_quota_info":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"tags":[{"description":"The Quota module for UAPI.","name":"Quota"},{"description":"cPanel Account / Disk Quotas","name":"Disk Quotas"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"tags":["Disk Quotas"],"name":"cPanel Account"}],"paths":{"/Quota/get_local_quota_info":{"get":{"description":"This function retrieves the cPanel account's quota for the server where you run the function. For example, a [distributed cPanel account](https://go.cpanel.net/glossaryD) could approach its quota. The servers will balance that cPanel user's quota between the parent and the child node.\n\n**Note:**\n\n  This function runs on **only** the local server. To retrieve the cPanel account's total quota, use the UAPI `Quota::get_quota` function instead.","operationId":"get_local_quota_info","parameters":[],"x-cpanel-available-version":"cPanel 88","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"type":"object","properties":{"bytes_used":{"type":"integer","minimum":"0","example":"4149284","description":"The amount of disk space the cPanel account uses on this server, in bytes.\n* A positive integer.\n* `0` - No usage or disabled server quotas."},"inode_limit":{"minimum":"0","type":"integer","example":"0","description":"The limit for inodes that the cPanel account may use on this server.\n* A positive integer.\n* `0` - Unlimited or disabled server quotas."},"inodes_used":{"example":"1035","description":"The number of inodes that the cPanel account uses on this server.\n* A positive integer.\n* `0` - No usage or disabled server quotas.","minimum":"0","type":"integer"},"byte_limit":{"description":"The limit for disk space the cPanel account may use on this server, in bytes.\n* A positive integer.\n* `0` - Unlimited or disabled server quotas.\n\n**Note:**\n\n This value does **not** update immediately.","example":"262144000","type":"integer","minimum":"0"}}},"metadata":{"properties":{}}},"type":"object"},"module":{"type":"string","example":"Quota","description":"The name of the module called."},"func":{"type":"string","example":"get_local_quota_info","description":"The name of the method called."}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Quota \\\n  get_local_quota_info\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Quota/get_local_quota_info"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Quota_get_local_quota_info.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Quota_get_local_quota_info.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/Quota/,\n    q/get_local_quota_info/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Quota_get_local_quota_info.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Quota_get_local_quota_info.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    'Quota',\n    'get_local_quota_info'\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}"}],"tags":["Quota","Disk Quotas"],"summary":"Return local disk quota information","x-cpanel-api-version":"UAPI"}}}},"get_quota_info":{"tags":[{"name":"Quota","description":"The Quota module for UAPI."},{"name":"Disk Quotas","description":"cPanel Account / Disk Quotas"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"tags":["Disk Quotas"],"name":"cPanel Account"}],"paths":{"/Quota/get_quota_info":{"get":{"description":"This function retrieves the cPanel account's quota.","operationId":"get_quota_info","parameters":[],"x-cpanel-available-version":"cPanel 56","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_quota_info","type":"string"},"result":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"data":{"description":"An object containing the cPanel account's quota.","type":"object","properties":{"inodes_remain":{"description":"The account's available inode quota.\n\n* `0` — Unlimited or disabled server quotas.","example":"0","oneOf":[{"type":"integer","description":"Unlimited or disabled server quotas.","enum":["0"]},{"description":"A positive integer.","minimum":"1","type":"integer"}]},"under_inode_limit":{"description":"Whether the account is under its inode limit.\n\n* `1` — Under limit.\n* `0` — Over limit.","enum":["1","0"],"example":"0","type":"integer"},"under_quota_overall":{"type":"integer","enum":["1","0"],"example":"1","description":"Whether the account is under both its inode and disk megabyte (MB) limit.\n\n* `1` — Under limit.\n* `0` — Over limit."},"megabyte_limit":{"oneOf":[{"enum":["0"],"description":"Unlimited or disabled server quotas.","type":"number"},{"type":"number","minimum":"1","description":"A decimal number."}],"description":"The account's disk space limit, in megabytes (MB).\n\n* `0.00` — Unlimited or disabled server quotas.","example":"0"},"inode_limit":{"oneOf":[{"type":"integer","description":"Unlimited or disabled server quotas.","enum":["0"]},{"minimum":"1","type":"integer","description":"A positive integer."}],"description":"The account's inode quota limit.\n\n* `0` — Unlimited or disabled server quotas.","example":"0"},"inodes_used":{"oneOf":[{"type":"integer","description":"No usage or disabled server quotas.","enum":["0"]},{"description":"A positive integer.","type":"integer","minimum":"1"}],"example":"1035","description":"The account's number of used inodes.\n\n* `0` — No usage or disabled server quotas."},"under_megabyte_limit":{"description":"Whether the account is under its disk space limit, in megabytes (MB).\n\n* `1` — Under limit.\n* `0` — Over limit.","enum":["1","0"],"example":"1","type":"integer"},"megabytes_remain":{"oneOf":[{"description":"Unlimited or disabled server quotas.","enum":["0"],"type":"number"},{"description":"A decimal number.","type":"number","minimum":"1"}],"example":"0","description":"The account's available disk space in, megabytes (MB).\n\n* `0.00` — Unlimited or disabled server quotas."},"megabytes_used":{"example":"5.46","description":"The account's used disk space, in megabytes (MB).\n\n* `0.00` — No usage or disabled server quotas.","oneOf":[{"description":"Unlimited or disabled server quotas.","enum":["0"],"type":"number"},{"description":"A decimal number.","minimum":"1","type":"number"}]}}},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Quota"}},"type":"object"}}}}},"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Quota \\\n  get_quota_info\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Quota/get_quota_info"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Quota_get_quota_info.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Quota_get_quota_info.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/Quota/,\n    q/get_quota_info/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Quota_get_quota_info.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Quota_get_quota_info.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    'Quota',\n    'get_quota_info'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Quota","Disk Quotas"],"summary":"Return disk quota information","x-cpanel-api-version":"UAPI"}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"}}},"Team":{"set_password":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.103.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/Team/set_password":{"get":{"summary":"Set password for a team user","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  set_password \\\n  user='teamuser' \\\n  password='securepassword'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/set_password?user=teamuser&password=securepassword","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_set_password.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_set_password.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/Team/,\n    q/set_password/,\n    {\n        'user' => 'teamuser',\n        'password' => 'securepassword',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_set_password.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_set_password.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    'Team',\n    'set_password',\n    array (\n        'user' => 'teamuser',\n        'password' => 'securepassword',\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","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Team Users"],"x-cpanel-available-version":"106","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"set_password","type":"string"},"result":{"properties":{"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"type":"object","nullable":"true"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"Team","description":"The name of the module called."}}}}},"description":"HTTP Request was successful."}},"operationId":"set_team_user_password","description":"This function replaces the current password with a new one.","parameters":[{"schema":{"example":"teamuser","type":"string"},"description":"The username of the team user.","required":"true","name":"user","in":"query"},{"in":"query","name":"password","required":"true","description":"The password to set for the team user.","schema":{"type":"string","example":"securepassword"}}]}}},"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}]},"edit_team_user":{"paths":{"/Team/edit_team_user":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  edit_team_user \\\n  user='teamUser'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Team/edit_team_user?user=teamUser"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_edit_team_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_edit_team_user.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/Team/,\n    q/edit_team_user/,\n    {\n        'user' => 'teamUser',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_edit_team_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_edit_team_user.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    'Team',\n    'edit_team_user',\n    array (\n        'user' => 'teamUser',\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","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Team Users"],"summary":"Edit a team user","x-cpanel-api-version":"UAPI","parameters":[{"name":"user","in":"query","required":"true","description":"The username of the team user.","schema":{"type":"string","example":"teamUser"}},{"schema":{"example":"teamuser@example.com","type":"string"},"description":"The primary contact email address to set for the team user.","required":"false","in":"query","name":"email1"},{"description":"The secondary contact email address to set for the team user.","schema":{"type":"string","example":"teamuser@example.com"},"in":"query","name":"email2","required":"false"},{"description":"The password to set for the team user.","schema":{"type":"string","example":"securepassword"},"in":"query","name":"password","required":"false"},{"description":"The role or roles to set for the team user.","schema":{"example":"email","type":"string"},"name":"set_role","in":"query","required":"false"},{"schema":{"type":"string","example":"database"},"description":"The role or roles to add to the team user.","required":"false","name":"add_role","in":"query"},{"description":"The role or roles to remove from the team user.","schema":{"type":"string","example":"database"},"in":"query","name":"remove_role","required":"false"},{"description":"Notes about the new team user. This field should not contain private information.","schema":{"type":"string","example":"This is a note about teamUser"},"in":"query","name":"notes","required":"false"},{"name":"set_expire","in":"query","required":"false","description":"The epoch time the team user account expires on or the offset in days.","examples":{"unix-timestamp":{"value":"1649948169"},"offset":{"value":"120days"}},"schema":{"oneOf":[{"type":"integer"},{"type":"string"}]}},{"required":"false","in":"query","name":"expire_reason","schema":{"type":"string","example":"teamUser gave a two week notice."},"description":"The reason for expiration."},{"required":"false","name":"services.email.enabled","in":"query","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"description":"Whether to create or remove an email subaccount for the team user. A subaccount is always created for a team user, but it does not have any associated service subaccounts by default.\n\n* `1` - Create and associate an email subaccount.\n* `0` - Remove any associated email subaccounts."},{"description":"The maximum amount of disk space, in megabytes (MB), allocated to the team user's email account.\n\n* `0` or `unlimited` - The subaccount has unlimited disk space.\n\nThis value defaults to the defined system value.\n\n**Note:**\n\nThis value **cannot** be larger than the system's maximum email quota.","schema":{"type":"string","example":"500"},"in":"query","name":"services.email.quota","required":"false"},{"description":"Whether to create or remove an FTP subaccount for the team user. A subaccount is always created for a team user, but it does not have any associated service subaccounts by default.\n\n* `1` - Create and associate an FTP subaccount.\n* `0` - Remove any associated FTP subaccounts.","schema":{"type":"integer","default":"0","example":"1","enum":["0","1"]},"name":"services.ftp.enabled","in":"query","required":"false"},{"schema":{"example":"/Teamusername","format":"path","type":"string"},"description":"The team user's FTP home directory, relative to the cPanel account's home directory.\n\n**Note:**\n\n* This parameter is **required** if you enabled the `services.ftp.homedir` parameter.\n* The directory **must** exist.","required":"false","name":"services.ftp.homedir","in":"query"},{"required":"false","in":"query","name":"services.webdisk.enabled","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"description":"Whether to create or remove a Web Disk subaccount for the team user. A subaccount is always created for a team user, but it does not have any associated service subaccounts by default.\n\n* `1` - Create and associate a Web Disk subaccount.\n* `0` - Remove any associated Web Disk subaccounts."},{"required":"false","name":"services.webdisk.enabledigest","in":"query","schema":{"enum":["0","1"],"example":"0","default":"0","type":"integer"},"description":"Whether to enable the Web Disk Digest Authentication.\n\n* `1` - Enabled.\n* `0` - Disabled.\n\n**Note:**\n\n* **Only** enable Digest Authentication for clients that require additional compatibility support on\n  certain versions of Windows® operating systems. This compatibility support is **only** required on servers\n  that use a self-signed certificate for the `cpsrvd` and `cpdavd` daemons.\n* We recommend that you do **not** use Digest Authentication."},{"schema":{"enum":["0","1"],"example":"1","default":"0","type":"integer"},"description":"Whether to set the directory's permissions to public or private.\n\n* `1` - Private (`0700`).\n* `0` - Public (`0755`).","required":"false","in":"query","name":"services.webdisk.private"},{"schema":{"example":"/Teamusername","format":"path","type":"string"},"description":"The team user's Web Disk home directory, relative to the cPanel account's home directory.\n\n**Note:**\n\nThis parameter is **required** if you enable the `services.webdisk.enabled` parameter.","required":"false","in":"query","name":"services.webdisk.homedir"},{"name":"services.webdisk.perms","in":"query","required":"false","description":"The team user's file permissions for its Web Disk home directory.\n\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.\n\n**Note:**\n\n The `services.webdisk.homedir` parameter determines the team user's Web Disk home directory.","schema":{"default":"rw","example":"rw","type":"string"}}],"operationId":"edit_team_user","description":"This function modifies a team user.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"data":{"type":"object","nullable":"true"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["1","0"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"}}},"module":{"example":"Team","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"edit_team_user","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"110"}}},"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.103.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"password_reset_request":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.107.0.9999"},"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"cPanel Account","tags":["Team Users"]}],"paths":{"/Team/password_reset_request":{"get":{"summary":"Sends a password reset request link to team user.","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  password_reset_request \\\n  user='teamuser'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/password_reset_request?user=teamuser","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_password_reset_request.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_password_reset_request.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/Team/,\n    q/password_reset_request/,\n    {\n        'user' => 'teamuser',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_password_reset_request.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_password_reset_request.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    'Team',\n    'password_reset_request',\n    array (\n        'user' => 'teamuser',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Team Users"],"x-cpanel-available-version":"108","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["1","0"],"example":"1"},"data":{"type":"object","nullable":"true"},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"module":{"type":"string","example":"Team","description":"The name of the module called."},"func":{"example":"password_reset_request","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"operationId":"password_reset_request","description":"This function enables a team user to reset the password by sending a password reset request link.","parameters":[{"schema":{"type":"string","example":"teamuser"},"description":"The username of the team user.","required":"true","name":"user","in":"query"}]}}}},"remove_roles":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.107.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Team/remove_roles":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Team"},"result":{"properties":{"data":{"type":"object","nullable":"true"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"enum":["1","0"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"remove_roles","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"108","parameters":[{"name":"user","in":"query","required":"true","description":"The username of the team user.","schema":{"example":"teamuser","type":"string"}},{"in":"query","name":"role","required":"true","description":"The role or roles to remove from the team user.","schema":{"example":"database","type":"string"}}],"operationId":"remove_roles","description":"This function removes roles from a team user.","x-cpanel-api-version":"UAPI","summary":"Remove roles from a team user","tags":["Team Users"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  remove_roles \\\n  user='teamuser' \\\n  role='database'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/remove_roles?user=teamuser&role=database","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_remove_roles.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_remove_roles.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/Team/,\n    q/remove_roles/,\n    {\n        'user' => 'teamuser',\n        'role' => 'database',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_remove_roles.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_remove_roles.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    'Team',\n    'remove_roles',\n    array (\n        'user' => 'teamuser',\n        'role' => 'database',\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}"}]}}},"x-tagGroups":[{"name":"cPanel Account","tags":["Team Users"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}]},"cancel_expire":{"paths":{"/Team/cancel_expire":{"get":{"x-cpanel-api-version":"UAPI","summary":"Stop a team user from expiring","tags":["Team Users"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  cancel_expire \\\n  user='teamUser'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Team/cancel_expire?user=teamUser"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_cancel_expire.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_cancel_expire.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/Team/,\n    q/cancel_expire/,\n    {\n        'user' => 'teamUser',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_cancel_expire.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_cancel_expire.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    'Team',\n    'cancel_expire',\n    array (\n        'user' => 'teamUser',\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-available-version":"110","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"expire_team_user","description":"The name of the method called."},"module":{"description":"The name of the module called.","example":"Team","type":"string"},"result":{"type":"object","properties":{"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["1","0"]},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"type":"object","nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}}}},"description":"HTTP Request was successful."}},"operationId":"cancel_expire","description":"This function stops a team user from expiring.","parameters":[{"required":"true","name":"user","in":"query","schema":{"example":"teamUser","type":"string"},"description":"The username of the team user."}]}}},"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The Team User module for UAPI.","name":"Team Users"}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.109.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"set_notes":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.103.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"openapi":"3.0.2","x-tagGroups":[{"name":"cPanel Account","tags":["Team Users"]}],"paths":{"/Team/set_notes":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"Team","description":"The name of the module called."},"result":{"properties":{"data":{"nullable":"true","type":"object"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"description":"The name of the method called.","example":"set_notes","type":"string"}}}}}}},"x-cpanel-available-version":"110","parameters":[{"schema":{"type":"string","example":"teamUser"},"description":"The username of the team user.","required":"true","name":"user","in":"query"},{"in":"query","name":"notes","required":"true","description":"The content of the notes field.","schema":{"type":"string","example":"teamUser is a good employee"}}],"operationId":"set_team_user_notes","description":"This function replaces the current notes field with new text.","summary":"Set notes for a team user","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  set_notes \\\n  user='teamUser' \\\n  notes='teamUser '\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/set_notes?user=teamUser&notes=teamUser%20","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_set_notes.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_set_notes.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/Team/,\n    q/set_notes/,\n    {\n        'user' => 'teamUser',\n        'notes' => 'teamUser ',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_set_notes.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_set_notes.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    'Team',\n    'set_notes',\n    array (\n        'user' => 'teamUser',\n        'notes' => 'teamUser ',\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"}],"tags":["Team Users"]}}},"tags":[{"description":"The Team User module for UAPI.","name":"Team Users"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"list_team_ui":{"tags":[{"description":"The Team User module for UAPI.","name":"Team Users"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"cPanel Account","tags":["Team Users"]}],"paths":{"/Team/list_team_ui":{"get":{"parameters":[],"x-cpanel-internal-only":"true","description":"This function lists the team users connected to a cPanel account.\nThis function transforms roles to titles.\nThis list is given in an array.","operationId":"list_team_ui","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"Team","description":"The name of the module called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"data":{"$ref":"#/components/schemas/TeamArray"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API."}}},"func":{"description":"The name of the method called.","example":"list_team_ui","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"104","tags":["Team Users"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  list_team_ui\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Team/list_team_ui"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_list_team_ui.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_list_team_ui.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/Team/,\n    q/list_team_ui/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_list_team_ui.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_list_team_ui.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    'Team',\n    'list_team_ui'\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","summary":"List Team Users"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.103.0.9999"},"components":{"schemas":{"TeamArray":{"type":"array","items":{"properties":{"expire_reason":{"type":"string","example":"team user 1 year"},"lastlogin":{"type":"integer","format":"unix_timestamp","example":"1650046110"},"notes":{"type":"string","example":"This is a note about team user."},"suspend_date":{"type":"integer","format":"unix-timestamp","example":"1650046210"},"username":{"type":"string","example":"teamuser"},"roles":{"type":"array","items":{"type":"string","example":"Email,Web"}},"expire_date":{"example":"1674575562","format":"unix_timestamp","type":"integer"},"suspend_reason":{"type":"string","example":"team user is on vacation"},"secondary-contact-email":{"type":"string","format":"email","example":"team_user_backup@example.com"},"created":{"type":"integer","format":"unix_timestamp","example":"1650036110"},"services":{"$ref":"#/components/schemas/Services"},"contact-email":{"type":"string","format":"email","example":"team_user@example.com"},"locale":{"type":"string","example":"en"}}}},"Services":{"properties":{"webdisk":{"example":"rw","type":"string"},"email":{"example":"500*2**20","type":"string"},"ftp":{"type":"integer","example":"1"}},"type":"object"}},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"add_roles":{"tags":[{"description":"The Team User module for UAPI.","name":"Team Users"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"paths":{"/Team/add_roles":{"get":{"x-cpanel-available-version":"108","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["1","0"],"type":"integer"},"data":{"nullable":"true","type":"object"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"Team","type":"string"},"func":{"type":"string","example":"add_roles","description":"The name of the method called."}},"type":"object"}}}}},"operationId":"add_roles","description":"This function adds roles to a team user.\n\n**Note:**\n\n  This action may result in team users gaining access to team owner level privileges.","parameters":[{"name":"user","in":"query","required":"true","description":"The username of the team user.","schema":{"example":"teamuser","type":"string"}},{"required":"true","name":"role","in":"query","schema":{"type":"string","example":"database"},"description":"The role or roles to add to the team user. Current roles include admin, database, email, web."}],"summary":"Add roles to a team user","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  add_roles \\\n  user='teamuser' \\\n  role='database'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/add_roles?user=teamuser&role=database","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_add_roles.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_add_roles.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/Team/,\n    q/add_roles/,\n    {\n        'user' => 'teamuser',\n        'role' => 'database',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_add_roles.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_add_roles.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    'Team',\n    'add_roles',\n    array (\n        'user' => 'teamuser',\n        'role' => 'database',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Team Users"]}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.107.0.9999"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"remove_team_user":{"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"paths":{"/Team/remove_team_user":{"get":{"description":"This function removes a team user.","operationId":"remove_team_user","parameters":[{"schema":{"example":"teamuser","type":"string"},"description":"The username of the team user.","required":"true","in":"query","name":"user"}],"x-cpanel-available-version":"108","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"remove_team_user","description":"The name of the method called.","type":"string"},"module":{"example":"Team","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"type":"object","nullable":"true"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}}}},"tags":["Team Users"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  remove_team_user \\\n  user='teamuser'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/remove_team_user?user=teamuser","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_remove_team_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_remove_team_user.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/Team/,\n    q/remove_team_user/,\n    {\n        'user' => 'teamuser',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_remove_team_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_remove_team_user.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    'Team',\n    'remove_team_user',\n    array (\n        'user' => 'teamuser',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Remove a team user"}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.107.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"reinstate_team_user":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"paths":{"/Team/reinstate_team_user":{"get":{"summary":"Reinstate a team user","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  reinstate_team_user \\\n  user='teamUser'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Team/reinstate_team_user?user=teamUser"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_reinstate_team_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_reinstate_team_user.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/Team/,\n    q/reinstate_team_user/,\n    {\n        'user' => 'teamUser',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_reinstate_team_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_reinstate_team_user.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    'Team',\n    'reinstate_team_user',\n    array (\n        'user' => 'teamUser',\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"}],"tags":["Team Users"],"x-cpanel-available-version":"108","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"reinstate_team_user","description":"The name of the method called.","type":"string"},"result":{"properties":{"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"nullable":"true","type":"object"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["1","0"],"example":"1","type":"integer"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"description":"The name of the module called.","example":"Team","type":"string"}}}}}}},"description":"This function reinstates a team user by removing any suspended or expired statuses. The reason field is also cleared.","operationId":"reinstate_team_user","parameters":[{"schema":{"example":"teamUser","type":"string"},"description":"The username of the team user.","required":"true","in":"query","name":"user"}]}}},"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","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/","version":"11.107.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"add_team_user":{"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"paths":{"/Team/add_team_user":{"get":{"tags":["Team Users"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  add_team_user \\\n  user='teamuser' \\\n  email1='teamuser@example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Team/add_team_user?user=teamuser&email1=teamuser%40example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_add_team_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_add_team_user.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/Team/,\n    q/add_team_user/,\n    {\n        'user' => 'teamuser',\n        'email1' => 'teamuser@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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_add_team_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_add_team_user.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    'Team',\n    'add_team_user',\n    array (\n        'user' => 'teamuser',\n        'email1' => 'teamuser@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","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Add a team user","parameters":[{"schema":{"example":"teamuser","type":"string"},"description":"The username of the team user. Follows cPanel standards.","required":"true","name":"user","in":"query"},{"description":"The contact email for the new team user.","schema":{"example":"teamuser@example.com","type":"string"},"name":"email1","in":"query","required":"true"},{"required":"false","in":"query","name":"email2","schema":{"type":"string","example":"teamuser-backup@example.com"},"description":"The secondary email for the new team user."},{"name":"password","in":"query","required":"false","description":"The password to set for the new team user.\n\n**Note:**\n\n * You must pass either the `password` or `activation_email` parameter.","schema":{"type":"string","example":"securepassword"}},{"description":"Send an email to the team user that allows them to set their own password.\n* `1` - Enabled.\n\n**Note:**\n\n * You must pass either the `password` or `activation_email` parameter.","schema":{"type":"integer","example":"1"},"in":"query","name":"activation_email","required":"false"},{"required":"false","name":"roles","in":"query","schema":{"type":"string","example":"email,database"},"description":"A comma-separated list of roles assigned to the new team user. Current roles include admin, database, email, web."},{"required":"false","name":"notes","in":"query","schema":{"example":"This is a note about teamuser","type":"string"},"description":"Notes about the new team user. This field should not contain private information. Maximum of 100 characters."},{"schema":{"oneOf":[{"type":"integer"},{"type":"string"}]},"examples":{"offset":{"value":"120days"},"unix-timestamp":{"value":"1649948169"}},"description":"The epoch time on which the team user account expires, or the offset from the current time, in days. Integers are treated as Unix Epoch Time unless followed by 'days'.","required":"false","name":"expire_date","in":"query"},{"description":"The reason for expiration.","schema":{"type":"string","example":"teamUser gave a two week notice."},"name":"expire_reason","in":"query","required":"false"},{"in":"query","name":"services.email.enabled","required":"false","description":"Whether to create an email subaccount for the team user. A subaccount is always created for a team user, but it does not have any associated service subaccounts by default.\n\n* `1` - Create an email subaccount.\n* `0` - **Do Not** create an email subaccount.","schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"}},{"schema":{"example":"500","type":"string"},"description":"The maximum amount of disk space, in megabytes (MB), allocated to the team user's email account.\n\n* `0` or `unlimited` - The subaccount has unlimited disk space.\n\nThis value defaults to the defined system value.\n\n**Note:**\n\nThis value **cannot** be larger than the system's maximum email quota.","required":"false","name":"services.email.quota","in":"query"},{"required":"false","in":"query","name":"services.ftp.enabled","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"description":"Whether to create an FTP subaccount for the team user. A subaccount is always created for a team user, but it does not have any associated service subaccounts by default.\n\n* `1` - Create an FTP subaccount.\n* `0` - **Do Not** create an FTP subaccount."},{"schema":{"format":"path","example":"/Teamusername","type":"string"},"description":"The team user's FTP home directory, relative to the cPanel account's home directory.\n\n**Note:**\n\n* This parameter is **required** if you enabled the `services.ftp.homedir` parameter.\n* The directory **must** exist.","required":"false","in":"query","name":"services.ftp.homedir"},{"description":"Whether to create a Web Disk subaccount for the team user. A subaccount is always created for a team user, but it does not have any associated service subaccounts by default.\n\n* `1` - Create a Web Disk subaccount.\n* `0` - **Do Not** create a Web Disk subaccount.","schema":{"type":"integer","example":"1","enum":["0","1"],"default":"0"},"in":"query","name":"services.webdisk.enabled","required":"false"},{"required":"false","name":"services.webdisk.enabledigest","in":"query","schema":{"default":"0","enum":["0","1"],"example":"0","type":"integer"},"description":"Whether to enable the Web Disk Digest Authentication.\n\n* `1` - Enabled.\n* `0` - Disabled.\n\n**Note:**\n\n* **Only** enable Digest Authentication for clients that require additional compatibility support on\n  certain versions of Windows® operating systems. This compatibility support is **only** required on servers\n  that use a self-signed certificate for the `cpsrvd` and `cpdavd` daemons.\n* We recommend that you do **not** use Digest Authentication."},{"required":"false","in":"query","name":"services.webdisk.private","schema":{"type":"integer","example":"1","enum":["0","1"],"default":"0"},"description":"Whether to set the directory's permissions to public or private.\n\n* `1` - Private (`0700`).\n* `0` - Public (`0755`)."},{"schema":{"type":"string","format":"path","example":"/Teamusername"},"description":"The team user's Web Disk home directory, relative to the cPanel account's home directory.\n\n**Note:**\n\nThis parameter is **required** if you enable the `services.webdisk.enabled` parameter.","required":"false","name":"services.webdisk.homedir","in":"query"},{"schema":{"type":"string","example":"rw","default":"rw"},"description":"The team user's file permissions for its Web Disk home directory.\n\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.\n\n**Note:**\n\n The `services.webdisk.homedir` parameter determines the team user's Web Disk home directory.","required":"false","name":"services.webdisk.perms","in":"query"}],"operationId":"add_team_user","description":"This function creates and adds a new team user.\n\n**Note:**\n\n  This action may result in team users gaining access to team owner level privileges.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Team"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"format":"unix-timestamp","description":"The unix timestamp that represents when the team user expires.","example":"1674575562","type":"integer"},"status":{"example":"1","enum":["1","0"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"}}},"func":{"type":"string","description":"The name of the method called.","example":"add_team_user"}},"type":"object"}}}}},"x-cpanel-available-version":"104"}}},"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"version":"11.103.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"set_expire":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.109.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"openapi":"3.0.2","x-tagGroups":[{"name":"cPanel Account","tags":["Team Users"]}],"paths":{"/Team/set_expire":{"get":{"x-cpanel-api-version":"UAPI","summary":"Set a team user to expire","tags":["Team Users"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  set_expire \\\n  user='teamUser' \\\n  date='120days'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/set_expire?user=teamUser&date=120days","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_set_expire.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_set_expire.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/Team/,\n    q/set_expire/,\n    {\n        'user' => 'teamUser',\n        'date' => '120days',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_set_expire.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_set_expire.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    'Team',\n    'set_expire',\n    array (\n        'user' => 'teamUser',\n        'date' => '120days',\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","label":"LiveAPI PHP","lang":"PHP"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null},"data":{"type":"integer","description":"The unix timestamp that represents when the team user expires.","format":"unix-timestamp","example":"1674575562"},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"description":"The name of the module called.","example":"Team","type":"string"},"func":{"type":"string","example":"set_expire","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"110","parameters":[{"required":"true","in":"query","name":"user","schema":{"example":"teamUser","type":"string"},"description":"The username of the team user."},{"name":"reason","in":"query","required":"false","description":"The reason for expiration.","schema":{"example":"teamUser gave a two week notice.","type":"string"}},{"description":"The epoch time on which the team user account expires, or the offset from the current time, in days. Integers are treated as Unix Epoch Time unless followed by 'days'.","examples":{"offset":{"value":"120days"},"unix-timestamp":{"value":"1649948169"}},"schema":{"oneOf":[{"type":"integer"},{"type":"string"}]},"in":"query","name":"date","required":"true"}],"description":"This function expires a team user after a specified amount of time.\n\nIf the team user already has an expire date set, it's replaced with a new date and reason.","operationId":"set_expire"}}},"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}]},"set_contact_email":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The Team User module for UAPI.","name":"Team Users"}],"paths":{"/Team/set_contact_email":{"get":{"parameters":[{"required":"true","in":"query","name":"user","schema":{"type":"string","example":"teamUser"},"description":"The username of the team user."},{"schema":{"type":"string","example":"email1@example.com"},"description":"The primary contact email address to set for the team user.","required":"false","name":"email1","in":"query"},{"description":"The secondary contact email address to set for the team user.","schema":{"type":"string","example":"email2@example.com"},"name":"email2","in":"query","required":"false"}],"operationId":"set_team_user_contact_email","description":"This function sets or changes primary and secondary email addresses.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["1","0"],"type":"integer"},"data":{"type":"object","nullable":"true"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"Team","description":"The name of the module called.","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"set_contact_email"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"110","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  set_contact_email \\\n  user='teamUser'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/set_contact_email?user=teamUser","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_set_contact_email.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_set_contact_email.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/Team/,\n    q/set_contact_email/,\n    {\n        'user' => 'teamUser',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_set_contact_email.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_set_contact_email.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    'Team',\n    'set_contact_email',\n    array (\n        'user' => 'teamUser',\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","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Team Users"],"summary":"Set a contact email address for a team user","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.103.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"list_team":{"x-tagGroups":[{"name":"cPanel Account","tags":["Team Users"]}],"paths":{"/Team/list_team":{"get":{"tags":["Team Users"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  list_team\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Team/list_team"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_list_team.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_list_team.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/Team/,\n    q/list_team/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_list_team.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_list_team.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    'Team',\n    'list_team'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"List Team Users","parameters":[{"description":"The format in which the team data is listed.","schema":{"type":"string","example":"array"},"in":"query","name":"format","required":"false"}],"description":"This function lists the team users connected to a cPanel account.\nThis list is given in an array by default, but can be given in a hash.","operationId":"list_team","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"Team","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"oneOf":[{"$ref":"#/components/schemas/TeamArray"},{"$ref":"#/components/schemas/TeamHash"}]},"status":{"example":"1","enum":["1","0"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"list_team"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"104"}}},"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{"Services":{"type":"object","properties":{"email":{"example":"500*2**20","type":"string"},"webdisk":{"type":"string","example":"rw"},"ftp":{"example":"1","type":"integer"}}},"TeamHash":{"type":"object","properties":{"owner":{"type":"string","example":"cPanelUser"},"users":{"properties":{"info":{"properties":{"locale":{"example":"en","type":"string"},"created":{"type":"integer","example":"1650036110","format":"unix_timestamp"},"password":{"type":"string","example":"encryptedpassword"},"contact-email":{"format":"email","example":"team_user@example.com","type":"string"},"services":{"$ref":"#/components/schemas/Services"},"expire_date":{"example":"1674575562","format":"unix_timestamp","type":"integer"},"suspend_date":{"type":"string"},"roles":{"type":"array","items":{"example":"email,web","type":"string"}},"suspend_reason":{"type":"string","example":"teamUser is on vacation"},"secondary-contact-email":{"example":"team_user_backup@example.com","format":"email","type":"string"},"expire_reason":{"type":"string","example":"team user 1 year"},"notes":{"example":"This is a note about team_user.","type":"string"},"lastlogin":{"format":"unix_timestamp","example":"1650046110","type":"integer"}}},"username":{"example":"teamuser","type":"string"}}}}},"TeamArray":{"type":"array","items":{"properties":{"locale":{"type":"string","example":"en"},"services":{"$ref":"#/components/schemas/Services"},"password":{"type":"string","example":"encryptedpassword"},"contact-email":{"type":"string","format":"email","example":"team_user@example.com"},"created":{"type":"integer","example":"1650036110","format":"unix_timestamp"},"secondary-contact-email":{"type":"string","example":"team_user_backup@example.com","format":"email"},"suspend_reason":{"example":"team user is on vacation","type":"string"},"suspend_date":{"example":"1650046210","format":"unix-timestamp","type":"integer"},"username":{"type":"string","example":"teamuser"},"roles":{"items":{"type":"string","example":"email,web"},"type":"array"},"expire_date":{"example":"1674575562","format":"unix_timestamp","type":"integer"},"notes":{"example":"This is a note about team user.","type":"string"},"lastlogin":{"format":"unix_timestamp","example":"1650046110","type":"integer"},"expire_reason":{"type":"string","example":"team user 1 year"}}}}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.103.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"openapi":"3.0.2"},"get_team_users_with_roles_count":{"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"paths":{"/Team/get_team_users_with_roles_count":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  get_team_users_with_roles_count\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Team/get_team_users_with_roles_count"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_get_team_users_with_roles_count.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_get_team_users_with_roles_count.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/Team/,\n    q/get_team_users_with_roles_count/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_get_team_users_with_roles_count.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_get_team_users_with_roles_count.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    'Team',\n    'get_team_users_with_roles_count'\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"}],"tags":["Team Users"],"summary":"Get number of team users with roles","x-cpanel-api-version":"UAPI","operationId":"get_team_users_with_roles_count","description":"This function returns the current and maximum number of team users with roles.","parameters":[],"x-cpanel-available-version":"118","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"get_team_users_with_roles_count","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"data":{"properties":{"max":{"description":"Maximum number of team users with roles.\n\n**Note:**\n\nThis value is stored in the package.","example":"7","type":"integer"},"used":{"example":"2","description":"The current number of team users with roles.","type":"integer"}}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"description":"- `1` - Success.\n- `0` - Failed: Check the `errors` field for more details.","example":"1","enum":["1","0"],"type":"integer"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"nullable":"true","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Team"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"version":"11.118.0","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"suspend_team_user":{"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Team User module for UAPI.","name":"Team Users"}],"paths":{"/Team/suspend_team_user":{"get":{"tags":["Team Users"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  suspend_team_user \\\n  user='teamuser'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/suspend_team_user?user=teamuser","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_suspend_team_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_suspend_team_user.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/Team/,\n    q/suspend_team_user/,\n    {\n        'user' => 'teamuser',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_suspend_team_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_suspend_team_user.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    'Team',\n    'suspend_team_user',\n    array (\n        'user' => 'teamuser',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Suspend a team user","operationId":"suspend_team_user","description":"This function immediately suspends a team user.","parameters":[{"description":"The username of the team user.","schema":{"type":"string","example":"teamuser"},"in":"query","name":"user","required":"true"},{"description":"The reason for suspension.","schema":{"example":"teamuser is on vacation","type":"string"},"name":"reason","in":"query","required":"false"}],"x-cpanel-available-version":"108","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Team","description":"The name of the module called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"data":{"nullable":"true","type":"object"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["1","0"],"type":"integer"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}}}},"func":{"type":"string","description":"The name of the method called.","example":"suspend_team_user"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["Team Users"],"name":"cPanel Account"}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.107.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"set_locale":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.107.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"x-tagGroups":[{"name":"cPanel Account","tags":["Team Users"]}],"paths":{"/Team/set_locale":{"get":{"parameters":[{"description":"The username of the team user.","schema":{"example":"teamuser","type":"string"},"in":"query","name":"user","required":"true"},{"in":"query","name":"locale","required":"true","description":"The new locale for the team user.","schema":{"type":"string","example":"es_es"}}],"description":"This function sets locale for a team user.","operationId":"Team::set_locale","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"Team","description":"The name of the module called.","type":"string"},"result":{"properties":{"data":{"nullable":"true","type":"object"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["1","0"],"type":"integer"},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"example":"set_locale","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"108","tags":["Team Users"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  set_locale \\\n  user='teamuser' \\\n  locale='es_es'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Team/set_locale?user=teamuser&locale=es_es"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_set_locale.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_set_locale.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/Team/,\n    q/set_locale/,\n    {\n        'user' => 'teamuser',\n        'locale' => 'es_es',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_set_locale.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_set_locale.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    'Team',\n    'set_locale',\n    array (\n        'user' => 'teamuser',\n        'locale' => 'es_es',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Set locale for a team user"}}},"tags":[{"description":"The Team User module for UAPI.","name":"Team Users"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"set_roles":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.107.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"openapi":"3.0.2","x-tagGroups":[{"name":"cPanel Account","tags":["Team Users"]}],"paths":{"/Team/set_roles":{"get":{"tags":["Team Users"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Team \\\n  set_roles \\\n  user='teamuser'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Team/set_roles?user=teamuser","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Team_set_roles.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Team_set_roles.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/Team/,\n    q/set_roles/,\n    {\n        'user' => 'teamuser',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Team_set_roles.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Team_set_roles.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    'Team',\n    'set_roles',\n    array (\n        'user' => 'teamuser',\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","summary":"Set roles for a team user","parameters":[{"schema":{"example":"teamuser","type":"string"},"description":"The username of the team user.","required":"true","name":"user","in":"query"},{"schema":{"type":"string","example":"database"},"description":"The role or roles to set for the team user. Current roles include admin, database, email, web.","required":"false","name":"role","in":"query"}],"operationId":"set_roles","description":"This function sets roles for a team user.\n\n**Note:**\n\n  This action may result in team users gaining access to team owner level privileges.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"set_roles","description":"The name of the method called.","type":"string"},"module":{"example":"Team","description":"The name of the module called.","type":"string"},"result":{"properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"data":{"nullable":"true","type":"object"},"status":{"type":"integer","description":"- `1` - Success\n- `0` - Failed: Check the errors field for more details.","example":"1","enum":["1","0"]},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"108"}}},"tags":[{"name":"Team Users","description":"The Team User module for UAPI."}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]}},"PasswdStrength":{"get_required_strength":{"tags":[{"description":"The PasswdStrength module for UAPI.","name":"PasswdStrength"},{"name":"Password Strength","description":"Server Information / Password Strength"}],"servers":[{"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."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Password Strength"],"name":"Server Information"}],"paths":{"/PasswdStrength/get_required_strength":{"get":{"operationId":"get_required_strength","description":"This function retrieves an application's minimum required password strength.","parameters":[{"description":"The application's name.","schema":{"type":"string","example":"webdisk","enum":["cpaddons","createacct","ftp","htaccess","mysql","passwd","pop","postgres","sshkey","webdisk","virtual"]},"name":"app","in":"query","required":"true"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_required_strength"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"data":{"properties":{"strength":{"minimum":"0","type":"integer","maximum":"100","description":"The application's minimum password strength.","example":"0"}},"type":"object"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}}}},"module":{"description":"The name of the module called.","example":"PasswdStrength","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  PasswdStrength \\\n  get_required_strength \\\n  app='webdisk'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/PasswdStrength/get_required_strength?app=webdisk"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file PasswdStrength_get_required_strength.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/PasswdStrength_get_required_strength.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/PasswdStrength/,\n    q/get_required_strength/,\n    {\n        'app' => 'webdisk',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file PasswdStrength_get_required_strength.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/PasswdStrength_get_required_strength.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    'PasswdStrength',\n    'get_required_strength',\n    array (\n        'app' => 'webdisk',\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}"}],"tags":["PasswdStrength","Password Strength"],"summary":"Return minimum required password strength","x-cpanel-api-version":"UAPI"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}}},"CCS":{"list_delegates":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["Calendar and Contacts Server"],"name":"Optional Applications"}],"paths":{"/CCS/list_delegates":{"get":{"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CCS \\\n  list_delegates\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/CCS/list_delegates"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CCS_list_delegates.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CCS_list_delegates.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/CCS/,\n    q/list_delegates/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CCS_list_delegates.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CCS_list_delegates.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    'CCS',\n    'list_delegates'\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}"}],"tags":["CCS","Calendar and Contacts Server"],"operationId":"list_delegates","description":"This function lists all [calendar delegates](https://docs.cpanel.net/cpanel/email/calendar-delegation/) on the cPanel account.\n\n**Note:**\n\nYou **must** install the [Calendar and Contacts Server](https://go.cpanel.net/CalendarAndContactsServer) cPanel plugin to access this API function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"CCS","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"type":"array","nullable":"true","description":"An array of objects that contain Calendars and Contacts Server calendar delegation information.","items":{"type":"object","properties":{"read_only":{"type":"integer","description":"Whether the delegatee has read-only access on the calendar.\n* `1` - Read-only access.\n* `0` - Full access.","enum":["1","0"],"example":"1"},"delegator":{"example":"delegator@cptest.test","description":"The calendar's owner.","format":"email","type":"string"},"delegatee":{"type":"string","format":"email","description":"The user with delegation rights.","example":"delegatee@cptest.test"}}}},"metadata":{"properties":{}},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}},"type":"object"},"func":{"type":"string","description":"The name of the method called.","example":"list_delegates"}},"type":"object"}}}}},"summary":"List cPanel account's calendar delegates","x-cpanel-api-version":"UAPI","x-cpanel-available-version":"cPanel 90"}}},"tags":[{"name":"CCS","description":"The CCS module for UAPI."},{"description":"Optional Applications / Calendar and Contacts Server","name":"Calendar and Contacts Server"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"list_users":{"paths":{"/CCS/list_users":{"get":{"x-cpanel-api-version":"UAPI","summary":"List cPanel account's calendar users","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"CCS","description":"The name of the module called."},"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"status":{"type":"integer","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"additionalProperties":{"description":"The user account's [universally unique identifier](https://en.wikipedia.org/wiki/Universally_unique_identifier) (UUID). The user account's name is the return's name."},"type":"object","example":{"user3@example.com":"195C8A51-E1B3-11E6-8715-F54FA4E00DDD","user4@example.com":"028F4AB1-0F1A-11E7-AEC7-E08FECEC8036","user1@example.com":"0882362A-0B98-11E8-BAF5-D988266709C1","user2@example.com":"96F1EB2F-A501-11EA-A3EF-A553B2E4FFA8"}},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","example":"list_users","description":"The name of the method called."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 90","tags":["CCS","Calendar and Contacts Server"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CCS \\\n  list_users\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/CCS/list_users"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CCS_list_users.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CCS_list_users.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/CCS/,\n    q/list_users/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CCS_list_users.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CCS_list_users.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    'CCS',\n    'list_users'\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}","lang":"PHP","label":"LiveAPI PHP"}],"operationId":"list_users","description":"This function lists all calendar users on the cPanel account.\n\n**Note:**\n\nYou **must** install the [Calendar and Contacts Server](https://go.cpanel.net/CalendarAndContactsServer) cPanel plugin to access this API function."}}},"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts Server"]}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"CCS","description":"The CCS module for UAPI."},{"description":"Optional Applications / Calendar and Contacts Server","name":"Calendar and Contacts Server"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"add_delegate":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/CCS/add_delegate":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"status":{"type":"integer","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"CCS","description":"The name of the module called.","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"add_delegate"}}}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CCS \\\n  add_delegate \\\n  delegator='delegator@cptest.test' \\\n  delegatee='delegatee@cptest.test'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/CCS/add_delegate?delegator=delegator%40cptest.test&delegatee=delegatee%40cptest.test","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CCS_add_delegate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CCS_add_delegate.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/CCS/,\n    q/add_delegate/,\n    {\n        'delegator' => 'delegator@cptest.test',\n        'delegatee' => 'delegatee@cptest.test',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CCS_add_delegate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CCS_add_delegate.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    'CCS',\n    'add_delegate',\n    array (\n        'delegator' => 'delegator@cptest.test',\n        'delegatee' => 'delegatee@cptest.test',\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}"}],"x-cpanel-rpm-version":"69","parameters":[{"description":"The calendar's owner.","schema":{"type":"string","example":"delegator@cptest.test","format":"email"},"name":"delegator","in":"query","required":"true"},{"schema":{"example":"delegatee@cptest.test","format":"email","type":"string"},"description":"The user to whom you wish to delegate the calendar.","required":"true","in":"query","name":"delegatee"},{"in":"query","name":"readonly","required":"false","description":"Whether the delegatee will only have read-only access on the calendar.\n* `1` - Read-only access.\n* `0` - Full access.","schema":{"enum":["1","0"],"example":"1","default":"0","type":"integer"}}],"x-cpanel-minimum-compatible-version":"80","description":"This function delegates a user's calendar to another user.\n\n**Note:**\n\nYou **must** install the [Calendar and Contacts Server](https://go.cpanel.net/CalendarAndContactsServer) cPanel plugin to access this API function.","operationId":"add_delegate","x-cpanel-available-version":"cPanel 90","tags":["CCS","Calendar and Contacts Server"],"x-cpanel-rpm":"cpanel-ccs-calendarserver","x-cpanel-api-version":"UAPI","summary":"Add calendar delegation"}}},"x-tagGroups":[{"tags":["Calendar and Contacts Server"],"name":"Optional Applications"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"CCS","description":"The CCS module for UAPI."},{"description":"Optional Applications / Calendar and Contacts Server","name":"Calendar and Contacts Server"}]},"update_delegate":{"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts Server"]}],"paths":{"/CCS/update_delegate":{"get":{"parameters":[{"required":"true","name":"delegator","in":"query","schema":{"format":"email","example":"user1@example.com","type":"string"},"description":"The calendar's owner."},{"required":"true","in":"query","name":"delegatee","schema":{"type":"string","example":"user2@example.com","format":"email"},"description":"The user to whom you delegated the calendar."},{"description":"Whether the delegatee will only have read-only access on the calendar.\n* `1` - Read-only access.\n* `0` - Full access.","schema":{"example":"1","default":"0","type":"integer"},"name":"readonly","in":"query","required":"false"}],"operationId":"update_delegate","description":"This function updates the delegation of a user's calendar to another user.\n\n**Note:**\n\nYou **must** install the [Calendar and Contacts Server](https://go.cpanel.net/CalendarAndContactsServer) cPanel plugin to access this API function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"update_delegate"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"metadata":{"properties":{}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"module":{"description":"The name of the module called.","example":"CCS","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 90","tags":["CCS","Calendar and Contacts Server"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CCS \\\n  update_delegate \\\n  delegator='user1@example.com' \\\n  delegatee='user2@example.com'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/CCS/update_delegate?delegator=user1%40example.com&delegatee=user2%40example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CCS_update_delegate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CCS_update_delegate.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/CCS/,\n    q/update_delegate/,\n    {\n        'delegator' => 'user1@example.com',\n        'delegatee' => 'user2@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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CCS_update_delegate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CCS_update_delegate.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    'CCS',\n    'update_delegate',\n    array (\n        'delegator' => 'user1@example.com',\n        'delegatee' => 'user2@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}"}],"x-cpanel-api-version":"UAPI","summary":"Update calendar delegation"}}},"tags":[{"name":"CCS","description":"The CCS module for UAPI."},{"description":"Optional Applications / Calendar and Contacts Server","name":"Calendar and Contacts Server"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2"},"remove_delegate":{"openapi":"3.0.2","info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The CCS module for UAPI.","name":"CCS"},{"name":"Calendar and Contacts Server","description":"Optional Applications / Calendar and Contacts Server"}],"paths":{"/CCS/remove_delegate":{"get":{"operationId":"remove_delegate","description":"This function removes a delegate from another user's calendar.\n\n**Note:**\n\nYou **must** install the [Calendar and Contacts Server](https://go.cpanel.net/CalendarAndContactsServer) cPanel plugin to access this API function.","parameters":[{"required":"true","in":"query","name":"delegator","schema":{"format":"email","example":"user1@example.com","type":"string"},"description":"The calendar's owner."},{"schema":{"format":"email","example":"user2@example.com","type":"string"},"description":"The user from whom you wish to remove delegation rights.","required":"true","name":"delegatee","in":"query"}],"x-cpanel-available-version":"cPanel 90","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"metadata":{"properties":{}},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"CCS"},"func":{"example":"remove_delegate","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CCS \\\n  remove_delegate \\\n  delegator='user1@example.com' \\\n  delegatee='user2@example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/CCS/remove_delegate?delegator=user1%40example.com&delegatee=user2%40example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CCS_remove_delegate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CCS_remove_delegate.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/CCS/,\n    q/remove_delegate/,\n    {\n        'delegator' => 'user1@example.com',\n        'delegatee' => 'user2@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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CCS_remove_delegate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CCS_remove_delegate.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    'CCS',\n    'remove_delegate',\n    array (\n        'delegator' => 'user1@example.com',\n        'delegatee' => 'user2@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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["CCS","Calendar and Contacts Server"],"summary":"Remove calendar delegation","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts Server"]}]}},"Chrome":{"get_dom":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"name":"cPanel Theme Management","tags":["Brand Management"]}],"paths":{"/Chrome/get_dom":{"get":{"summary":"Return cPanel theme header and footer HTML","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Chrome \\\n  get_dom \\\n  page_title='Test'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Chrome/get_dom?page_title=Test","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Chrome_get_dom.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Chrome_get_dom.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/Chrome/,\n    q/get_dom/,\n    {\n        'page_title' => 'Test',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Chrome_get_dom.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Chrome_get_dom.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    'Chrome',\n    'get_dom',\n    array (\n        'page_title' => 'Test',\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}"}],"tags":["Chrome","Brand Management"],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"type":"object","properties":{"footer":{"type":"string","example":"\n<!-- The Footer HTML of the user's assigned theme -->\n</html>\n\n","description":"The pages' footer."},"header":{"type":"string","example":"\n\n<!DOCTYPE html>\n\n<html lang=\"en\" dir=\"ltr\">\n<!-- The Header HTML of the user's assigned theme -->","description":"The pages' header."}}},"metadata":{"properties":{}},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}},"module":{"description":"The name of the module called.","example":"Chrome","type":"string"},"func":{"type":"string","example":"get_dom","description":"The name of the method called."}},"type":"object"}}}}},"operationId":"get_dom","description":"This function returns header and footer HTML. You can use this HTML to create a page with the same visual appearance as your cPanel theme.","parameters":[{"description":"The title of the page to wrap in the theme's headers and footers.","schema":{"type":"string","example":"Test"},"name":"page_title","in":"query","required":"true"}]}}},"tags":[{"name":"Chrome","description":"The Chrome module for UAPI."},{"description":"cPanel Theme Management / Brand Management","name":"Brand Management"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]}},"Session":{"create_webmail_session_for_mail_user":{"tags":[{"name":"Session","description":"The Session module for UAPI."},{"name":"Webmail Sessions","description":"Email / Webmail Sessions"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Webmail Sessions"],"name":"Email"}],"paths":{"/Session/create_webmail_session_for_mail_user":{"get":{"tags":["Session","Webmail Sessions"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Session \\\n  create_webmail_session_for_mail_user \\\n  login='username' \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Session/create_webmail_session_for_mail_user?login=username&domain=example.com","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Session_create_webmail_session_for_mail_user.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Session_create_webmail_session_for_mail_user.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/Session/,\n    q/create_webmail_session_for_mail_user/,\n    {\n        'login' => 'username',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Session_create_webmail_session_for_mail_user.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Session_create_webmail_session_for_mail_user.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    'Session',\n    'create_webmail_session_for_mail_user',\n    array (\n        'login' => 'username',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Create Webmail session","parameters":[{"required":"true","name":"login","in":"query","schema":{"type":"string","example":"username"},"description":"The Webmail account's username."},{"description":"The domain for the Webmail account.","schema":{"example":"example.com","type":"string"},"name":"domain","in":"query","required":"true"},{"name":"locale","in":"query","required":"false","description":"The [locale](https://go.cpanel.net/localedocs) that the new session will use.\n\n**Note:**\n\n* You must **only** enter lowercase characters.\n* This parameter defaults to the cPanel user's locale.","schema":{"type":"string","example":"en"}},{"schema":{"type":"string","format":"ipv4","example":"192.168.0.1"},"description":"The session's client IP address.\n\n**Note:**\n\n* If you run this function from the command line, this parameter is **required**.\n* This parameter defaults to the API caller's IP address.","required":"false","name":"remote_address","in":"query"}],"operationId":"create_webmail_session_for_mail_user","description":"Create a temporary session for a cPanel user to connect to Webmail.\n\n**Note:**\n\nThe cPanel user must own the Webmail account.\n\n### How to use this API\n\nAfter you successfully call this API, you will need to log in to [Webmail](https://go.cpanel.net/webmailinterface).\nTo do this, send an HTTP POST to `https://$URL_AUTHTY:2096$token/login` with a message body of `session=$session` where:\n\n* `$URL_AUTHTY` represents the value from the `hostname` return.\n  * If the `hostname` return value is `null`, enter the hostname of the server that answered the API function.\n  * `$token` represents the value from the token return.\n* `$session` represents the value of the session return.\n\nFor example, an HTTP POST may resemble the following:\n\n```https://hostname.example.com:2096/cpsess2462418786/login```\n\nWith a message body of:\n\n```session=username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_MAIL_USER,728fb86a7df1cf20690c65f349ac3137```","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"data":{"properties":{"hostname":{"type":"string","example":"hostname.example.com","description":"The Webmail server's hostname.\n\n**Note:**\n\nThe function returns a `null` value when the Webmail server is not remote.","nullable":"true"},"token":{"description":"A new security token.","example":"/cpsess2462418786","type":"string"},"session":{"example":"username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_MAIL_USER,728fb86a7df1cf20690c65f349ac3137","description":"The session ID to submit via POST to begin using the new session.","type":"string"}},"type":"object"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]}},"type":"object"},"module":{"description":"The name of the module called.","example":"Session","type":"string"},"func":{"description":"The name of the method called.","example":"create_webmail_session_for_mail_user","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 86"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"create_webmail_session_for_mail_user_check_password":{"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Session","description":"The Session module for UAPI."},{"description":"Email / Webmail Sessions","name":"Webmail Sessions"}],"paths":{"/Session/create_webmail_session_for_mail_user_check_password":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"data":{"properties":{"hostname":{"example":"hostname.example.com","description":"The Webmail server's hostname.\n\n**Note:**\n\nThe function returns a `null` value when the Webmail server is not remote.","nullable":"true","type":"string"},"token":{"type":"string","description":"A new security token.","example":"/cpsess2462418786"},"session":{"example":"username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_MAIL_USER,728fb86a7df1cf20690c65f349ac3137","description":"The session value to submit via POST to begin using the new session.","type":"string"}},"type":"object"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"}}},"module":{"example":"Session","description":"The name of the module called.","type":"string"},"func":{"example":"create_webmail_session_for_mail_user_check_password","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 86","parameters":[{"name":"login","in":"query","required":"true","description":"The Webmail account's username.","schema":{"type":"string","example":"username"}},{"required":"true","name":"domain","in":"query","schema":{"type":"string","example":"example.com"},"description":"The domain for the Webmail account."},{"name":"password","in":"query","required":"true","description":"The password for the Webmail account.","schema":{"example":"luggage12345","type":"string"}},{"required":"false","in":"query","name":"locale","schema":{"example":"en","type":"string"},"description":"The [locale](https://go.cpanel.net/localedocs) that the new session will use.\n\n**Note:**\n\n* You must **only** enter lowercase characters.\n* This parameter defaults to the cPanel user's locale."},{"required":"false","name":"remote_address","in":"query","schema":{"type":"string","example":"192.168.0.1","format":"ipv4"},"description":"The session's account's client IP address.\n\n**Note:**\n\n* If you run this function from the command line, this parameter is **required**.\n* This parameter defaults to the API caller's IP address."}],"operationId":"create_webmail_session_for_mail_user_check_password","description":"This function creates a temporary session with a password for the calling cPanel user to connect to Webmail.\n\n**Note:**\n\n* The cPanel user must own the Webmail account.\n* This function works like the UAPI Session::create_webmail_session_for_mail_user function with one exception. This function requires a correct password to create the Webmail session. If you use an incorrect password or attempt to connect to a suspended account, the login will fail.\n\n### How to use this API\n\nAfter you successfully call this API, you will need to log in to [Webmail](https://go.cpanel.net/webmailinterface).\nTo do this, send an HTTP POST to `https://$URL_AUTHTY:2096$token/login` with a message body of `session=$session` where:\n\n* `$URL_AUTHTY` represents the value from the `hostname` return.\n  * If the `hostname` return value is `null`, enter the hostname of the server that answered the API function.\n  * `$token` represents the value from the token return.\n* `$session` represents the value of the session return.\n\nFor example, an HTTP POST may resemble the following:\n\n```https://hostname.example.com:2096/cpsess2462418786/login```\n\nWith a message body of:\n\n```session=username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_MAIL_USER,728fb86a7df1cf20690c65f349ac3137```","x-cpanel-api-version":"UAPI","summary":"Create Webmail session with credentials","tags":["Session","Webmail Sessions"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Session \\\n  create_webmail_session_for_mail_user_check_password \\\n  login='username' \\\n  domain='example.com' \\\n  password='luggage12345'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Session/create_webmail_session_for_mail_user_check_password?login=username&domain=example.com&password=luggage12345"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Session_create_webmail_session_for_mail_user_check_password.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Session_create_webmail_session_for_mail_user_check_password.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/Session/,\n    q/create_webmail_session_for_mail_user_check_password/,\n    {\n        'login' => 'username',\n        'domain' => 'example.com',\n        'password' => 'luggage12345',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Session_create_webmail_session_for_mail_user_check_password.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Session_create_webmail_session_for_mail_user_check_password.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    'Session',\n    'create_webmail_session_for_mail_user_check_password',\n    array (\n        'login' => 'username',\n        'domain' => 'example.com',\n        'password' => 'luggage12345',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"x-tagGroups":[{"tags":["Webmail Sessions"],"name":"Email"}]},"create_temp_user":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"tags":[{"name":"Session","description":"The Session module for UAPI."},{"description":"Email / Webmail Sessions","name":"Webmail Sessions"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Webmail Sessions"]}],"paths":{"/Session/create_temp_user":{"get":{"summary":"Create user session with existing session","x-cpanel-api-version":"UAPI","x-cpanel-cli-support":"false","x-codeSamples":[{"source":"https://hostname.example.com:2083/cpsess##########/execute/Session/create_temp_user","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Session_create_temp_user.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Session_create_temp_user.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/Session/,\n    q/create_temp_user/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Session_create_temp_user.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Session_create_temp_user.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    'Session',\n    'create_temp_user'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Session","Webmail Sessions"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"create_temp_user","description":"The name of the method called.","type":"string"},"module":{"example":"Session","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"type":"object","properties":{"created":{"description":"Whether the function successfully created the temporary user session.\n* `1` - Success.\n* `0` - Failure.","enum":["0","1"],"example":"1","type":"integer"},"session_temp_user":{"example":"cpses_reviY3ZSQK","description":"The temporary user's session ID.","type":"string"}}},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54.0.16","parameters":[],"operationId":"create_temp_user","description":"This function creates a temporary user session.\n\n**Important:**\n\n* Because this function requires a valid cPanel session ID, you **must** call it via a cPanel or Webmail session URL. If you call this function via the command line or Template Toolkit, it will **not** create a temporary user session. You **must** use the WHM API 1 `create_user_session` function to create a temporary user session.\n* Third-party plugins that require access to temporary MySQL users **must** call this function via the URL. It will create the temporary users before they are available. You can find these users in the `$ENV{'REMOTE_DBOWNER'}` environment variable.\n* If you **cannot** update your system, update your scripts to call the `Cgi::phpmyadminlink` function. This will create a temporary user session for you."}}}},"create_webmail_session_for_self":{"paths":{"/Session/create_webmail_session_for_self":{"get":{"x-cpanel-available-version":"cPanel 86","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Session","description":"The name of the module called."},"result":{"properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"data":{"type":"object","properties":{"session":{"description":"The session value to submit via POST to begin using the new session.","example":"username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_SELF,728fb86a7df1cf20690c65f349ac3137","type":"string"},"hostname":{"type":"string","nullable":"true","example":"hostname.example.com","format":"domain","description":"The Webmail server's hostname.\n\n**Note:**\n\nThe function returns a `null` value when the Webmail server is **not** remote."},"token":{"description":"A new security token.","example":"/cpsess2462418786","type":"string"}}},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"example":"create_webmail_session_for_self","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"Create a temporary session to connect to Webmail for the authenticated cPanel user.\n\n### How to use this API\n\nAfter you successfully call this API, you will need to log in to [Webmail](https://go.cpanel.net/webmailinterface).\nTo do this, send an HTTP POST to `https://$URL_AUTHTY:2096$token/login` with a message body of `session=$session` where:\n\n* `$URL_AUTHTY` represents the value from the `hostname` return.\n  * If the `hostname` return value is `null`, enter the hostname of the server that answered the API function.\n  * `$token` represents the value from the token return.\n* `$session` represents the value of the session return.\n\nFor example, an HTTP POST may resemble the following:\n\n```https://hostname.example.com:2096/cpsess2462418786/login```\n\nWith a message body of:\n\n```session=username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_MAIL_USER,728fb86a7df1cf20690c65f349ac3137```","operationId":"create_webmail_session_for_self","parameters":[{"name":"locale","in":"query","required":"false","description":"The [locale](https://go.cpanel.net/localedocs) that the new session will use.\n\nUse UAPI `Locale::list_locales` to see a list of valid locales.\n\n**Note:**\n\n* You must **only** enter lowercase characters.\n* This parameter defaults to the cPanel user's locale.","schema":{"example":"en","type":"string"}},{"in":"query","name":"remote_address","required":"false","description":"The session's client IP address.\n\n**Note:**\n\n* If you run this function from the command line, this parameter is **required**.\n* This parameter defaults to the API caller's IP address.","schema":{"example":"192.168.0.1","format":"ipv4","type":"string"}}],"summary":"Create Webmail session for current user","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Session \\\n  create_webmail_session_for_self\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Session/create_webmail_session_for_self"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Session_create_webmail_session_for_self.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Session_create_webmail_session_for_self.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/Session/,\n    q/create_webmail_session_for_self/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Session_create_webmail_session_for_self.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Session_create_webmail_session_for_self.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    'Session',\n    'create_webmail_session_for_self'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Session","Webmail Sessions"]}}},"x-tagGroups":[{"tags":["Webmail Sessions"],"name":"Email"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Session module for UAPI.","name":"Session"},{"description":"Email / Webmail Sessions","name":"Webmail Sessions"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"}},"Resellers":{"list_accounts":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Resellers/list_accounts":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return reseller's cPanel accounts","tags":["Resellers","Account Information"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Resellers \\\n  list_accounts\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Resellers/list_accounts","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Resellers_list_accounts.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Resellers_list_accounts.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/Resellers/,\n    q/list_accounts/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Resellers_list_accounts.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Resellers_list_accounts.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    'Resellers',\n    'list_accounts'\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-available-version":"cPanel 11","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"list_accounts","type":"string"},"module":{"description":"The name of the module called.","example":"Resellers","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"data":{"items":{"type":"object","properties":{"user":{"format":"username","description":"The cPanel account's username.","example":"username","type":"string"},"domain":{"type":"string","example":"example.com","format":"domain","description":"The cPanel account's domain."},"select":{"type":"string","example":"1","enum":["1",""],"description":"Whether the cPanel account's user is currently logged in.\n\n* `1` — Logged in.\n* An empty string — **Not** logged in."}}},"description":"An array of objects containing the reseller's cPanel accounts.","type":"array"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1","type":"integer"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."}},"type":"object"}},"type":"object"}}}}},"description":"This function lists all of a reseller's cPanel accounts.","operationId":"list_accounts","parameters":[]}}},"x-tagGroups":[{"name":"cPanel Account","tags":["Account Information"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The Resellers module for UAPI.","name":"Resellers"},{"description":"cPanel Account / Account Information","name":"Account Information"}]}},"ServerInformation":{"get_information":{"x-tagGroups":[{"name":"Server Information","tags":["cPanel Server Information"]}],"paths":{"/ServerInformation/get_information":{"get":{"summary":"Return service and device status","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ServerInformation \\\n  get_information\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/ServerInformation/get_information"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ServerInformation_get_information.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/ServerInformation_get_information.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/ServerInformation/,\n    q/get_information/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ServerInformation_get_information.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/ServerInformation_get_information.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    'ServerInformation',\n    'get_information'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["ServerInformation","cPanel Server Information"],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_information","description":"The name of the method called.","type":"string"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"type":"array","example":[{"type":"service","value":"up","name":"apache_php_fpm","status":"1"},{"status":"1","name":"cpanel-dovecot-solr","value":"up","type":"service"},{"name":"cpanellogd","value":"up","type":"service","status":"1"},{"status":"1","name":"cpdavd","value":"up","type":"service"},{"status":"1","name":"cphulkd","type":"service","value":"up"},{"name":"cpsrvd","type":"service","value":"up","status":"1"},{"status":"1","name":"crond","value":"up","type":"service"},{"name":"dnsadmin","type":"service","value":"up","status":"1"},{"name":"exim","type":"service","value":"up","status":"1","version":"exim-4.92-1.cp1180.x86_64"},{"type":"service","value":"up","name":"ftpd","status":"1"},{"name":"httpd","value":"up","type":"service","status":"1","version":"2.4.39"},{"type":"service","value":"up","name":"imap","status":"1"},{"name":"ipaliases","type":"service","value":"up","status":"1"},{"status":"1","name":"lmtp","value":"up","type":"service"},{"name":"mailman","type":"service","value":"up","status":"1"},{"version":"5.7.25","status":"1","type":"service","value":"up","name":"mysql"},{"type":"service","value":"up","name":"named","status":"1"},{"status":"1","value":"up","type":"service","name":"nscd"},{"status":"1","name":"pop","value":"up","type":"service"},{"type":"service","value":"up","name":"queueprocd","status":"1"},{"status":"1","name":"rsyslogd","value":"up","type":"service"},{"type":"service","value":"up","name":"spamd","status":"1"},{"status":"1","name":"sshd","value":"up","type":"service"},{"status":"1","type":"metric","value":"1.73","name":"Server Load"},{"status":"1","value":"2","type":"metric","name":"CPU Count"},{"status":"1","type":"device","value":"44.12%","name":"Memory Used"},{"name":"Swap","value":"0.73%","type":"device","status":"1"},{"name":"Disk / (/)","value":"26%","type":"device","status":"1"},{"status":"1","type":"device","value":"0%","name":"Disk /tmp (/tmp)"},{"name":"Disk /var/tmp (/var/tmp)","value":"0%","type":"device","status":"1"}],"items":{"properties":{"name":{"description":"The cPanel services, devices, and server health check points on the\nserver.\n\n* A valid [cPanel service](https://go.cpanel.net/ThecPanelWHMServiceDaemons). \n* `CPU Count` — The number of CPUs on the server.\n* `Disk mount (mount)` — The server's disk mounts, where `mount`\nrepresents the disk mount location.\n* `Server Load` — The server's CPU load.\n* `Memory Used` — The server's current memory use.\n* `Swap` — The server's swap space.","example":"cpsrvd","type":"string"},"error":{"type":"string","description":"An error message about why system couldn't read a resource's status file.","example":"nscd is reporting errors."},"type":{"type":"string","description":"The type of resource.\n\n* `device`\n* `metric`\n* `service`","enum":["device","metric","service"],"example":"service"},"value":{"description":"The resource's status.\n\n* `up`\n* `down`\n* `unknown`\n* The current resource usage.","anyOf":[{"type":"string","enum":["up","down","unknown"],"description":"The resource's status."},{"type":"string","description":"The resource's current usage."}]},"status":{"description":"Whether the resource is enabled or disabled.\n\n* `1` — Enabled.\n* `0` — Disabled.\n* `unknown` — The system couldn't determine the resource's status.","example":"1","oneOf":[{"type":"integer","enum":["1","0"],"description":"Whether the resource is enabled or disabled."},{"type":"string","enum":["unknown"],"description":"The system couldn't determine the resource's status."}]},"version":{"type":"string","description":"The resource's software version.\n\n**Important:**\n\nThe function **only** returns this value if a valid software\nversion exists.","example":"exim-4.92-1.cp1178.x86_64"}},"type":"object"},"description":"An array of objects containing the server's status."},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"ServerInformation","description":"The name of the module called.","type":"string"}}}}}}},"operationId":"get_information","description":"This function returns the status of each\n[cPanel service (daemon)](https://go.cpanel.net/ThecPanelWHMServiceDaemons),\ndevice, and server health check point on your server.","parameters":[]}}},"tags":[{"description":"The ServerInformation module for UAPI.","name":"ServerInformation"},{"name":"cPanel Server Information","description":"Server Information / Server Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"openapi":"3.0.2"}},"UserTasks":{"delete":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"x-tagGroups":[{"tags":["SSE Task Management"],"name":"API Development Tools"}],"paths":{"/UserTasks/delete":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty --user=username UserTasks delete id='00000000\\/5a9ec8dd4c345d'","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserTasks/delete?id=00000000%5c%2f5a9ec8dd4c345d","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserTasks_delete.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserTasks_delete.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/UserTasks/,\n    q/delete/,\n    {\n        'id' => '00000000\\/5a9ec8dd4c345d',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserTasks_delete.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserTasks_delete.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    'UserTasks',\n    'delete',\n    array (\n        'id' => '00000000\\/5a9ec8dd4c345d',\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}"}],"tags":["UserTasks","SSE Task Management"],"summary":"Remove item from task queue","x-cpanel-api-version":"UAPI","parameters":[{"description":"The task's ID number.","schema":{"example":"00000000\\/5a9ec8dd4c345d","type":"string"},"in":"query","name":"id","required":"true"}],"description":"This function deletes a process from the user task queue.\n\nEach cPanel account uses a separate user task queue in order to ensure that\nprocesses for one user do not impede another user on the server.\n\n* For example, the [*Git Version Control*](https://go.cpanel.net/GitVersionControl)\ninterface (*cPanel >> Home >> Files >> Git Version Control*) uses the user task queue\nto clone repositories (via the `VersionControl::create` function).\n* For more information, read our\n[Task Queue Monitor](https://go.cpanel.net/whmdocsTaskQueueMonitor) documentation.","operationId":"UserTasks::delete","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"delete"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}}},"module":{"example":"UserTasks","description":"The name of the module called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 72"}}},"tags":[{"description":"The UserTasks module for UAPI.","name":"UserTasks"},{"name":"SSE Task Management","description":"API Development Tools / SSE Task Management"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"retrieve":{"x-tagGroups":[{"tags":["SSE Task Management"],"name":"API Development Tools"}],"paths":{"/UserTasks/retrieve":{"get":{"description":"This function retrieves a cPanel account's user task queue information.\n\nEach cPanel account uses a separate user task queue in order to ensure that\nprocesses for one user do not impede another user on the server.\n\n* For example, the [*Git Version Control*](https://go.cpanel.net/GitVersionControl)\ninterface (*cPanel >> Home >> Files >> Git Version Control*) uses the user task queue\nto clone repositories (via the `VersionControl::create` function).\n* For more information, read our\n[Task Queue Monitor](https://go.cpanel.net/whmdocsTaskQueueMonitor) documentation.","operationId":"retrieve","parameters":[],"x-cpanel-available-version":"cPanel 72","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"retrieve","type":"string"},"module":{"example":"UserTasks","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"data":{"example":[{"args":{},"action":"create","subsystem":"VersionControl","id":"00000000\\/5a9ec8dd4c345d"},{"id":"00000000/h39dnn27suc13l","args":{"repository_root":"/home/user/public_html/example"},"action":"create","subsystem":"VersionControl"}],"description":"An array of objects containing data for a task in the user task queue.","items":{"properties":{"action":{"enum":["create"],"example":"create","description":"The task's action.\n\n* `create`\n\n**Note:**\n\n`create` is the only possible value.","type":"string"},"subsystem":{"type":"string","description":"The subsystem that will handle the process.\n\n* `VersionControl`\n\n**Note:**\n\n`VersionControl` is the only possible value.","enum":["VersionControl"],"example":"VersionControl"},"args":{"description":"An object containing one or more action- and subsystem-specific\narguments, if any exist.\n\nFor example, a task that returns an `action` value of `create` and\na `subsystem` value of `VersionControl` will include the\n`repository_root` argument.","properties":{"repository_root":{"type":"string","description":"The absolute path to the repostiory's `root` directory."}},"type":"object"},"id":{"type":"string","description":"The task's ID number.","example":"00000000\\/5a9ec8dd4c345d"}},"type":"object"},"type":"array"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserTasks \\\n  retrieve\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/UserTasks/retrieve"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserTasks_retrieve.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserTasks_retrieve.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/UserTasks/,\n    q/retrieve/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserTasks_retrieve.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserTasks_retrieve.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    'UserTasks',\n    'retrieve'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["UserTasks","SSE Task Management"],"summary":"Return task queue information","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The UserTasks module for UAPI.","name":"UserTasks"},{"description":"API Development Tools / SSE Task Management","name":"SSE Task Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"}},"DAV":{"has_shared_global_addressbook":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/DAV/has_shared_global_addressbook":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"has_shared_global_addressbook","type":"string"},"module":{"example":"DAV","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"data":{"properties":{"shared":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the global address book is enabled.\n* `1` — Enabled.\n* `0` — **Not** enabled."}},"type":"object"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"}},"type":"object"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 54","parameters":[{"name":"name","in":"query","required":"false","description":"cPanel account user name or a Webmail user's email address. If you do **not** specify a user, this parameter defaults to the currently-authenticated user.","schema":{"type":"string","example":"user"}}],"description":"This function checks whether the shared global address book is enabled on the current cPanel account's webmail accounts.","operationId":"has_shared_global_addressbook","summary":"Return whether global address book is enabled","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DAV \\\n  has_shared_global_addressbook\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DAV/has_shared_global_addressbook"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DAV_has_shared_global_addressbook.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DAV_has_shared_global_addressbook.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/DAV/,\n    q/has_shared_global_addressbook/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DAV_has_shared_global_addressbook.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DAV_has_shared_global_addressbook.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    'DAV',\n    'has_shared_global_addressbook'\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}"}],"tags":["DAV","Calendar and Contacts (DAV)"]}}},"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"DAV","description":"The DAV module for UAPI."},{"name":"Calendar and Contacts (DAV)","description":"Optional Applications / Calendar and Contacts (DAV)"}]},"is_dav_service_enabled":{"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}],"paths":{"/DAV/is_dav_service_enabled":{"get":{"x-cpanel-available-version":"cPanel 11.50","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"data":{"properties":{"enabled":{"example":"1","enum":["0","1"],"description":"Whether the DAV service is enabled.\n* `1` — Enabled.\n* `0` — Disabled.","type":"integer"}},"type":"object"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"metadata":{"properties":{}},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"DAV"},"func":{"description":"The name of the method called.","example":"is_dav_service_enabled","type":"string"}},"type":"object"}}}}},"description":"This function checks whether the DAV service is enabled.","operationId":"is_dav_service_enabled","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return whether DAV is enabled","tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DAV \\\n  is_dav_service_enabled\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DAV/is_dav_service_enabled"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DAV_is_dav_service_enabled.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DAV_is_dav_service_enabled.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/DAV/,\n    q/is_dav_service_enabled/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DAV_is_dav_service_enabled.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DAV_is_dav_service_enabled.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    'DAV',\n    'is_dav_service_enabled'\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"tags":[{"name":"DAV","description":"The DAV module for UAPI."},{"name":"Calendar and Contacts (DAV)","description":"Optional Applications / Calendar and Contacts (DAV)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"disable_shared_global_addressbook":{"paths":{"/DAV/disable_shared_global_addressbook":{"get":{"x-cpanel-api-version":"UAPI","summary":"Disable global address book","tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DAV \\\n  disable_shared_global_addressbook\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DAV/disable_shared_global_addressbook"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DAV_disable_shared_global_addressbook.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DAV_disable_shared_global_addressbook.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/DAV/,\n    q/disable_shared_global_addressbook/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DAV_disable_shared_global_addressbook.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DAV_disable_shared_global_addressbook.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    'DAV',\n    'disable_shared_global_addressbook'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"status":{"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"properties":{"shared":{"description":"Whether the global address book is shared.\n* `1` — Shared.\n* `0` — **Not** shared.","enum":["0","1"],"example":"1","type":"integer"}},"type":"object"},"metadata":{"properties":{}},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"module":{"example":"DAV","description":"The name of the module called.","type":"string"},"func":{"type":"string","example":"disable_shared_global_addressbook","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","parameters":[{"description":"cPanel account username or a Webmail user's email address. If you do **not** specify a user, this parameter defaults to the currently-authenticated user.","schema":{"example":"user","type":"string"},"name":"name","in":"query","required":"false"}],"operationId":"disable_shared_global_addressbook","description":"This function disables the shared global address book for the current cPanel account's webmail accounts."}}},"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"description":"The DAV module for UAPI.","name":"DAV"},{"description":"Optional Applications / Calendar and Contacts (DAV)","name":"Calendar and Contacts (DAV)"}],"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"enable_shared_global_addressbook":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The DAV module for UAPI.","name":"DAV"},{"name":"Calendar and Contacts (DAV)","description":"Optional Applications / Calendar and Contacts (DAV)"}],"paths":{"/DAV/enable_shared_global_addressbook":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"enable_shared_global_addressbook","description":"The name of the method called.","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"DAV"},"result":{"properties":{"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"properties":{"shared":{"enum":["0","1"],"example":"1","description":"Whether the global address book is shared.\n* 1 — Shared.\n* 0 — **Not** shared.","type":"integer"}},"type":"object"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 54","parameters":[{"required":"false","in":"query","name":"name","schema":{"example":"user","type":"string"},"description":"cPanel account username or a Webmail user's email address. If you do **not** specify a user, this parameter defaults to the currently-authenticated user."}],"operationId":"enable_shared_global_addressbook","description":"This function enables the shared global address book for the current cPanel account's webmail accounts.","summary":"Enable global address book","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DAV \\\n  enable_shared_global_addressbook\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DAV/enable_shared_global_addressbook"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DAV_enable_shared_global_addressbook.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DAV_enable_shared_global_addressbook.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/DAV/,\n    q/enable_shared_global_addressbook/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DAV_enable_shared_global_addressbook.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DAV_enable_shared_global_addressbook.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    'DAV',\n    'enable_shared_global_addressbook'\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}"}],"tags":["DAV","Calendar and Contacts (DAV)"]}}},"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}]},"get_calendar_contacts_config":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"DAV","description":"The DAV module for UAPI."},{"name":"Calendar and Contacts (DAV)","description":"Optional Applications / Calendar and Contacts (DAV)"}],"paths":{"/DAV/get_calendar_contacts_config":{"get":{"tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DAV \\\n  get_calendar_contacts_config\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DAV/get_calendar_contacts_config","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DAV_get_calendar_contacts_config.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DAV_get_calendar_contacts_config.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/DAV/,\n    q/get_calendar_contacts_config/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DAV_get_calendar_contacts_config.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DAV_get_calendar_contacts_config.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    'DAV',\n    'get_calendar_contacts_config'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return CalDAV and CardDAV connection information","parameters":[{"name":"user","in":"query","required":"false","description":"A cPanel account or valid email account user.\n\nIf you do **not** include this parameter, the function defaults to the current\nauthenticated user.","schema":{"oneOf":[{"type":"string","format":"username","description":"A cPanel account.","example":"username"},{"type":"string","example":"username@example.com","format":"email","description":"A valid email account."}]}}],"description":"This function returns the connection information to set up the CalDAV and CardDAV clients.","operationId":"get_calendar_contacts_config","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"data":{"properties":{"user":{"type":"string","example":"username","description":"The cPanel user or email account user to\nwhom the returned connection information pertains.\n\nIf you do **not** specify the `user` parameter,\nthis function returns the authenticated cPanel user."},"ssl":{"description":"A list of SSL connection configurations.","type":"object","properties":{"full_server":{"format":"url","description":"The absolute URL path and HTTPS port to the user's CalDAV and\nCardDAV connection information.\n\n**Note:**\n\nThis information is useful for clients that do **not** support\nAutodiscovery.","example":"http://example.com:2080/rpc/principal/example","type":"string"},"contacts":{"items":{"properties":{"description":{"description":"The description of the address book.","example":"Custom address book 2.","type":"string"},"url":{"type":"string","format":"url","description":"The absolute URL to the address book.","example":"https://example.com:2080/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6"},"name":{"description":"The name of the address book.","example":"Address book 2","type":"string"},"path":{"description":"The relative URL to the address book.","example":"/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6","type":"string"}},"type":"object"},"description":"An array of objects containing the user's address books.","type":"array"},"free_busy":{"type":"string","example":"http://server.example.com:2080/kronolith/fb.php?u=example","format":"url","description":"The absolute URL path and HTTPS port to the user's CalDAV\n`free-busy-query` connection.\n\n**Note:**\n\nThis information is useful for clients that support Autodiscovery."},"server":{"example":"https://example.com:2080","format":"url","description":"The short server connection string that includes a\ndomain name and a port that uses the HTTPS protocol.\n\n**Note:**\n\nThis value is useful for clients that support Autodiscovery.","type":"string"},"calendars":{"items":{"properties":{"description":{"type":"string","example":"Custom calendar 2.","description":"The description of the calendar."},"name":{"example":"Calendar 2","description":"The name of the calendar.","type":"string"},"url":{"type":"string","example":"http://example.com:2080/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1","format":"url","description":"The absolute URL to the calendar."},"path":{"description":"The relative URL path to the calendar.","example":"/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1","type":"string"}},"type":"object"},"description":"An array of objects containing the user's calendars.","type":"array"},"port":{"example":"2080","description":"The port number that the system uses for SSL connections.","minimum":"1","maximum":"65535","type":"integer"},"is_self_signed":{"enum":["1","0"],"example":"1","description":"Whether the server uses a self-signed certificate.\n\n* `1` — Self-signed.\n* `0` — **Not** self-signed.","type":"integer"}}},"no_ssl":{"type":"object","properties":{"server":{"type":"string","example":"http://example.com:2079","format":"url","description":"The short server connection string that includes a domain name and a port that uses the HTTP protocol."},"free_busy":{"type":"string","example":"http://server.example.com:2079/kronolith/fb.php?u=example","format":"url","description":"The absolute URL path and HTTP port to the user's\nCalDAV `free-busy-query` connection.\n\n**Note:**\n\nThis information is useful for clients that support Autodiscovery."},"contacts":{"type":"array","items":{"properties":{"description":{"description":"The description of the address book.","example":"Custom address book 1.","type":"string"},"name":{"description":"The name of the address book.","example":"Custom 1","type":"string"},"url":{"type":"string","example":"https://example.com:2080/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6","description":"The absolute URL to the address book.","format":"url"},"path":{"type":"string","example":"/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6","description":"The relative URL to the address book."}},"type":"object"},"description":"An array of objects containing the user's address books."},"full_server":{"type":"string","example":"http://example.com:2079/rpc/principal/example","description":"The absolute URL path and HTTP port to the user's CalDAV\nand CardDAV connection information.\n\n**Note:**\n\nThis information is useful for clients that do **not** support Autodiscovery.","format":"url"},"port":{"type":"integer","maximum":"65535","minimum":"1","description":"The port number that the system uses for non-SSL connections.","example":"2079"},"calendars":{"description":"An array of objects containing the user's calendars.","items":{"type":"object","properties":{"description":{"description":"The description of the calendar.","example":"Custom calendar 1.","type":"string"},"name":{"description":"The name of the calendar.","example":"Calendar 1","type":"string"},"url":{"description":"The absolute URL to the calendar.","format":"url","example":"http://example.com:2079/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1","type":"string"},"path":{"example":"/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1","description":"The relative URL path to the calendar.","type":"string"}}},"type":"array"}},"description":"A list of non-SSL connection configurations."},"activesync":{"description":"Configuration details for ActiveSync.","properties":{"port":{"maximum":"65535","type":"integer","minimum":"1","example":"2091","description":"The port number the system uses for secure ActiveSync connections."},"server":{"type":"string","format":"domain","description":"The fully qualified domain name to connect to.","example":"example.com"},"user":{"type":"string","description":"The cPanel user or email account user to\nwhom the returned connection information pertains.\n\nIf you do **not** specify the `user` parameter,\nthis function returns the authenticated cPanel user.","example":"username"},"enabled":{"type":"integer","description":"Whether the server has ActiveSync enabled.\n* `1` — Enabled.\n* `0` — **Not** enabled.","enum":["1","0"],"example":"1"}},"type":"object"}},"type":"object"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1","type":"integer"},"metadata":{"properties":{}},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"}}},"module":{"description":"The name of the module called.","example":"DAV","type":"string"},"func":{"example":"get_calendar_contacts_config","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.50"}}},"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"is_horde_enabled":{"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"paths":{"/DAV/is_horde_enabled":{"get":{"tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DAV \\\n  is_horde_enabled\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DAV/is_horde_enabled"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DAV_is_horde_enabled.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DAV_is_horde_enabled.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/DAV/,\n    q/is_horde_enabled/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DAV_is_horde_enabled.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DAV_is_horde_enabled.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    'DAV',\n    'is_horde_enabled'\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","summary":"Return whether Horde is enabled","parameters":[],"operationId":"is_horde_enabled","description":"This function checks whether Horde is enabled. Since Horde is no longer installed with the product, the return value will only ever be 0.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"is_horde_enabled","type":"string"},"module":{"description":"The name of the module called.","example":"DAV","type":"string"},"result":{"type":"object","properties":{"data":{"type":"object","properties":{"enabled":{"enum":["0"],"example":"0","description":"Whether Horde is enabled. Always false because horde is no longer installed with the product.\n* `0` — Disabled.","type":"integer"}}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.50"}}},"x-tagGroups":[{"tags":["Calendar and Contacts (DAV)"],"name":"Optional Applications"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"DAV","description":"The DAV module for UAPI."},{"description":"Optional Applications / Calendar and Contacts (DAV)","name":"Calendar and Contacts (DAV)"}]}},"Mime":{"delete_mime":{"paths":{"/Mime/delete_mime":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"delete_mime","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"Mime"},"result":{"properties":{"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"type":"object","default":null,"nullable":"true"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"schema":{"type":"string","example":"text/foo"},"description":"The MIME type.","required":"true","name":"type","in":"query"}],"operationId":"delete_mime","description":"This function removes a MIME type from Apache.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/serverroles), the system **disables** this function.","summary":"Remove MIME type from web server","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  delete_mime \\\n  type='text/foo'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/delete_mime?type=text%2ffoo"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_delete_mime.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_delete_mime.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/Mime/,\n    q/delete_mime/,\n    {\n        'type' => 'text/foo',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_delete_mime.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_delete_mime.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    'Mime',\n    'delete_mime',\n    array (\n        'type' => 'text/foo',\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}"}],"tags":["Mime","Mime Type Management"]}}},"x-tagGroups":[{"name":"Website Configuration","tags":["Mime Type Management"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"Mime","description":"The Mime module for UAPI."},{"description":"Website Configuration / Mime Type Management","name":"Mime Type Management"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"list_handlers":{"tags":[{"description":"The Mime module for UAPI.","name":"Mime"},{"name":"Handler Management","description":"Website Configuration / Handler Management"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Handler Management"],"name":"Website Configuration"}],"paths":{"/Mime/list_handlers":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"list_handlers","description":"The name of the method called."},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"items":{"properties":{"origin":{"example":"user","description":"The handler's owner.\n- system\n- user","type":"string"},"handler":{"example":"text-foo","description":"The handler's name. A valid string.","type":"string"},"extension":{"type":"string","description":"The handler's extension. A valid file extension.","example":".foo"}},"type":"object"},"type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Mime"}},"type":"object"}}}}},"operationId":"list_handlers","description":"This function lists all of Apache's MIME handlers.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/serverroles),\n  the system **disables** this function.","parameters":[{"required":"true","name":"type","in":"query","schema":{"enum":["system","user"],"example":"user","type":"string"},"description":"Whether to retrieve system or user handlers."}],"summary":"Return web server's MIME handlers","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  list_handlers \\\n  type='user'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/list_handlers?type=user","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_list_handlers.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_list_handlers.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/Mime/,\n    q/list_handlers/,\n    {\n        'type' => 'user',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_list_handlers.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_list_handlers.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    'Mime',\n    'list_handlers',\n    array (\n        'type' => 'user',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mime","Handler Management"]}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"delete_handler":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"name":"Website Configuration","tags":["Handler Management"]}],"paths":{"/Mime/delete_handler":{"get":{"tags":["Mime","Handler Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  delete_handler \\\n  extension='.foo'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/delete_handler?extension=.foo","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_delete_handler.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_delete_handler.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/Mime/,\n    q/delete_handler/,\n    {\n        'extension' => '.foo',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_delete_handler.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_delete_handler.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    'Mime',\n    'delete_handler',\n    array (\n        'extension' => '.foo',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Remove web server MIME type handler","parameters":[{"name":"extension","in":"query","required":"true","description":"The file extension.","schema":{"type":"string","example":".foo"}}],"operationId":"delete_handler","description":"This function deletes an Apache MIME type handler.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"delete_handler"},"result":{"properties":{"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed: Check the `errors` field for more details."},"data":{"nullable":"true","default":null,"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Mime","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"tags":[{"description":"The Mime module for UAPI.","name":"Mime"},{"description":"Website Configuration / Handler Management","name":"Handler Management"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"add_redirect":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mime","description":"The Mime module for UAPI."},{"description":"Domain Management / Domain Redirection","name":"Domain Redirection"}],"paths":{"/Mime/add_redirect":{"get":{"operationId":"add_redirect","description":"This function adds a redirect to a domain.\n\n**Important:**\n\n  When you disable the [*Web Server* role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"type":"string","example":"example.com","format":"domain"},"description":"The domain from which to redirect.","required":"true","name":"domain","in":"query"},{"required":"false","in":"query","name":"src","schema":{"type":"string","example":"/specific-page","default":"/","format":"url-path"},"description":"A specific page from which to redirect."},{"required":"true","name":"redirect","in":"query","schema":{"example":"http://example.com/","format":"url","type":"string"},"description":"The URL to which to redirect."},{"name":"type","in":"query","required":"false","description":"Whether the redirect is temporary.\n * `permanent`\n * `temp`","schema":{"enum":["permanent","temp"],"example":"permanent","default":"permanent","type":"string"}},{"schema":{"example":"1","enum":["0","1"],"default":"0","type":"integer"},"description":"Whether to redirect all files within a directory to the same\nfilename within the destination directory.\n* `1` - Redirect all files within the directory.\n* `0` - Do **not** redirect all files within the directory.","required":"false","in":"query","name":"redirect_wildcard"},{"schema":{"type":"integer","example":"0","default":"0"},"description":"Whether to redirect domains with or without `www`.\n* `2` - Redirect with `www`.\n* `1` - Redirect without `www`.\n* `0` - Redirect with **and** without `www`.","required":"false","name":"redirect_www","in":"query"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"nullable":"true","default":null,"type":"object"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":["Htaccess Installed"],"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"}}},"module":{"example":"Mime","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"add_redirect","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  add_redirect \\\n  domain='example.com' \\\n  redirect='http://example.com/'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/add_redirect?domain=example.com&redirect=http%3a%2f%2fexample.com%2f","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_add_redirect.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_add_redirect.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/Mime/,\n    q/add_redirect/,\n    {\n        'domain' => 'example.com',\n        'redirect' => 'http://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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_add_redirect.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_add_redirect.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    'Mime',\n    'add_redirect',\n    array (\n        'domain' => 'example.com',\n        'redirect' => 'http://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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Mime","Domain Redirection"],"summary":"Add redirect to domain","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Domain Management","tags":["Domain Redirection"]}]},"add_hotlink":{"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/Mime/add_hotlink":{"get":{"tags":["Mime","Direct Link Protection (Hotlink)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  add_hotlink \\\n  urls='http://example.com/' \\\n  extensions='foo' \\\n  redirect_url='http://redirect.example.com/'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/add_hotlink?urls=http%3a%2f%2fexample.com%2f&extensions=foo&redirect_url=http%3a%2f%2fredirect.example.com%2f"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_add_hotlink.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_add_hotlink.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/Mime/,\n    q/add_hotlink/,\n    {\n        'urls' => 'http://example.com/',\n        'extensions' => 'foo',\n        'redirect_url' => 'http://redirect.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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_add_hotlink.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_add_hotlink.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    'Mime',\n    'add_hotlink',\n    array (\n        'urls' => 'http://example.com/',\n        'extensions' => 'foo',\n        'redirect_url' => 'http://redirect.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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Enable hotlink protection","description":"This function adds hotlink protection for a site. Hotlink protection will redirect users to another URL if they navigate to a file with a specified extension, but an allowed URL did not refer them.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"add_hotlink","parameters":[{"examples":{"single":{"value":"http://example.com/","summary":"Add hotlink protection for a single site."},"multiple":{"summary":"Add hotlink protection for multiple sites.","value":"http://example.com/\nhttp://foobar.com/"}},"description":"The site to hotlink protect.\n\n**Note:**\n\nTo protect multiple URLs, separate each URL with a newline character.","schema":{"type":"string"},"name":"urls","in":"query","required":"true"},{"in":"query","name":"extensions","required":"true","examples":{"single":{"summary":"Add hotlink protection for a single file extension.","value":"foo"},"multiple":{"summary":"Add hotlink protection for multiple file extensions.","value":"foo,bar"}},"description":"File types to hotlink protect.\n\n**Note:**\n\nTo protect multiple file types, use a comma-separated list.","schema":{"type":"string"}},{"in":"query","name":"allow_null","required":"false","description":"Whether the domain allows hotlinks.\n* `1` - Allows.\n* `0` - Does **not** allow.","schema":{"type":"integer","enum":["0","1"],"example":"1"}},{"schema":{"type":"string","format":"url","example":"http://redirect.example.com/"},"description":"The URL to which the system sends hotlinkers.","required":"true","name":"redirect_url","in":"query"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"add_hotlink","description":"The name of the method called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"default":null,"nullable":"true","type":"object"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"Mime","type":"string"}},"type":"object"}}}}}}}},"x-tagGroups":[{"tags":["Direct Link Protection (Hotlink)"],"name":"Domain Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"description":"The Mime module for UAPI.","name":"Mime"},{"description":"Domain Management / Direct Link Protection (Hotlink)","name":"Direct Link Protection (Hotlink)"}]},"delete_redirect":{"x-tagGroups":[{"tags":["Domain Redirection"],"name":"Domain Management"}],"paths":{"/Mime/delete_redirect":{"get":{"parameters":[{"required":"true","name":"domain","in":"query","schema":{"format":"domain","example":"example.com","type":"string"},"description":"The domain name."},{"required":"false","name":"docroot","in":"query","schema":{"example":"/home/example/public_html/","format":"path","type":"string"},"description":"The absolute file path to the document root containing the `.htaccess` file to change.\n\nIf you don't pass this parameter, the system looks up the document root from the `domain` parameter's value."},{"schema":{"type":"string","default":"","example":"redirectpage.html"},"description":"The specific page that redirects visitors.","required":"false","in":"query","name":"src"},{"description":"An argument string that contains the arguments of a `Redirect` or `RedirectMatch` directives.","schema":{"default":"","example":"redirectme http://redirectme.com/","type":"string"},"name":"args","in":"query","required":"false"}],"operationId":"delete_redirect","description":"This function removes a redirect from a domain.\n\n**Important:**\n\nWhen you disable the [Web Server role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Mime"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"data":{"type":"object","nullable":"true","default":null},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{}}}},"func":{"example":"delete_redirect","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","tags":["Mime","Domain Redirection"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  delete_redirect \\\n  domain='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/delete_redirect?domain=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_delete_redirect.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_delete_redirect.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/Mime/,\n    q/delete_redirect/,\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_delete_redirect.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_delete_redirect.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    'Mime',\n    'delete_redirect',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Remove redirect from domain"}}},"tags":[{"name":"Mime","description":"The Mime module for UAPI."},{"name":"Domain Redirection","description":"Domain Management / Domain Redirection"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"redirect_info":{"paths":{"/Mime/redirect_info":{"get":{"operationId":"redirect_info","description":"This function retrieves redirect information for a URL or `** All Public Domains **`.\n\n**Important:**\n\nWhen you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"type":"string","format":"url","example":"http://redirect.example.com"},"description":"The URL for which to retrieve redirector information.","required":"true","name":"url","in":"query"},{"schema":{"type":"string","format":"domain","example":"example.com"},"description":"The domain for which to retrieve redirector information.","required":"true","name":"domain","in":"query"}],"x-cpanel-internal-only":"false","x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"redirect_info","description":"The name of the method called."},"module":{"type":"string","example":"Mime","description":"The name of the module called."},"result":{"type":"object","properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"metadata":{"properties":{}},"data":{"properties":{"domain":{"anyOf":[{"description":"The redirect's domain.","format":"domain","type":"string"},{"type":"string","description":"** All Public Domains **"}],"type":"string","example":"example.com","description":"The redirect's domain, or `** All Public Domains **`.\n\n* A valid domain.\n* `** All Public Domains **`"},"url":{"example":"http://redirect.example.com","format":"url","description":"The redirect's URL.","type":"string"}},"type":"object"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}}}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  redirect_info \\\n  url='http://redirect.example.com' \\\n  domain='example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/redirect_info?url=http%3a%2f%2fredirect.example.com&domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_redirect_info.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_redirect_info.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/Mime/,\n    q/redirect_info/,\n    {\n        'url' => 'http://redirect.example.com',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_redirect_info.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_redirect_info.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    'Mime',\n    'redirect_info',\n    array (\n        'url' => 'http://redirect.example.com',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mime","Handler Management"],"summary":"Return redirect information","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Website Configuration","tags":["Handler Management"]}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Handler Management","description":"Website Configuration / Handler Management"},{"description":"The Mime module for UAPI.","name":"Mime"}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"delete_hotlink":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Mime module for UAPI.","name":"Mime"},{"name":"Direct Link Protection (Hotlink)","description":"Domain Management / Direct Link Protection (Hotlink)"}],"paths":{"/Mime/delete_hotlink":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"delete_hotlink","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"data":{},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"Mime"}},"type":"object"}}}}},"description":"This function removes hotlink protection.\n\n**Important:**\n\n  When you disable the [Web Server](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"delete_hotlink","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Disable hotlink protection","tags":["Mime","Direct Link Protection (Hotlink)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  delete_hotlink\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/delete_hotlink","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_delete_hotlink.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_delete_hotlink.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/Mime/,\n    q/delete_hotlink/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_delete_hotlink.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_delete_hotlink.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    'Mime',\n    'delete_hotlink'\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"x-tagGroups":[{"name":"Domain Management","tags":["Direct Link Protection (Hotlink)"]}]},"list_redirects":{"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mime","description":"The Mime module for UAPI."},{"name":"Domain Redirection","description":"Domain Management / Domain Redirection"}],"paths":{"/Mime/list_redirects":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return .htaccess files' redirects","tags":["Mime","Domain Redirection"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  list_redirects\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/list_redirects","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_list_redirects.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_list_redirects.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/Mime/,\n    q/list_redirects/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_list_redirects.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_list_redirects.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    'Mime',\n    'list_redirects'\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}","label":"LiveAPI PHP","lang":"PHP"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"list_redirects"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"items":{"properties":{"type":{"example":"permanent","enum":["permanent","temporary"],"description":"Whether the redirect is permanent or temporary.\n\n* `permanent` — The redirect is permanent.\n* `temporary` — The redirect is temporary.","type":"string"},"wildcard":{"type":"integer","example":"1","enum":["1","0"],"description":"Whether the wildcard subdomains match.\n\n* `1` — Matches.\n* `0` — Does **not** match."},"matchwww_text":{"enum":["checked"],"example":"checked","description":"Whether the [*Redirect with or without www.* option](https://go.cpanel.net/Redirects) is active.\n\n* `checked` — The *Redirect with or without www.* option is active.","type":"string"},"displaydomain":{"type":"string","description":"The domain to redirect.\n\n* `ALL` is the only possible value.","enum":["ALL"],"example":"ALL"},"docroot":{"format":"path","description":"The absolute file path to the source domain's document root.","example":"/home/example/public_html","type":"string"},"opts":{"type":"string","example":"L","description":"The options that the function passes to Apache as part of\nthe [Rewrite rule](https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_l)."},"statuscode":{"example":"301","description":"The [HTTP Status Code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) of the request","type":"string"},"targeturl":{"description":"The redirect's destination URL.","format":"url","example":"http://redirect.example.com/","type":"string"},"urldomain":{"type":"string","description":"The domain to redirect.","format":"domain","example":"example.com"},"domain":{"type":"string","format":"domain","description":"The domain to redirect.","example":"example.com"},"sourceurl":{"example":"/marceau.html","description":"The path to the file within the domain to test, relative to the home directory.","format":"url-path","type":"string"},"displaysourceurl":{"example":"/marceau.html","description":"The path to the file within the domain to test, relative to the home directory.","format":"url-path","type":"string"},"source":{"type":"string","format":"url-path","description":"The path to the file within the domain to test, relative to the home directory.","example":"/marceau.html"},"wildcard_text":{"description":"Whether the [*Wild Card Redirect*](https://go.cpanel.net/Redirects) option is active.\n\n* `checked` — The *Wild Card Redirect* option is active.","enum":["checked"],"example":"checked","type":"string"},"kind":{"type":"string","example":"rewrite","enum":["rewrite","redirect","redirectmatch"],"description":"The kind of redirect.\n\n* `rewrite` — The request sent a redirect to another path on the server.\n* `redirect` — The request sent a redirect for the URL.\n* `redirectmatch` — The request sent a redirect based on a regular\nexpression match of the URL."},"destination":{"type":"string","description":"The redirect's destination URL.","format":"url","example":"http://redirect.example.com/"},"matchwww":{"description":"Whether the redirect matches `www.` subdomains.\n* `1` — Matches.\n* `0` — Does not match.","example":"1","enum":["1","0"],"type":"integer"}},"type":"object"},"type":"array"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"],"type":"integer"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Mime"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"name":"regex","in":"query","required":"false","description":"A Perl regular expression that filters the results. The system matches the regular expression to the `sourceurl` return value.","schema":{"type":"string","example":"\"^[a-z0-9_-]{6,18}$\""}},{"required":"false","name":"destination","in":"query","schema":{"example":"http://example.tld","type":"string"},"description":"The string with which to filter results.\n\n** Note: **\n\nThis will **only** return results that match the `destination` parameter **exactly**."}],"operationId":"list_redirects","description":"This function lists the redirects in an account's .htaccess files.\n\n**Important:**\n\nWhen you disable the [Web Server role](https://go.cpanel.net/serverroles#roles), the system **disables** this function."}}},"x-tagGroups":[{"name":"Domain Management","tags":["Domain Redirection"]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"list_hotlinks":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"description":"The Mime module for UAPI.","name":"Mime"},{"name":"Direct Link Protection (Hotlink)","description":"Domain Management / Direct Link Protection (Hotlink)"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Domain Management","tags":["Direct Link Protection (Hotlink)"]}],"paths":{"/Mime/list_hotlinks":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"metadata":{"properties":{}},"data":{"properties":{"extensions":{"type":"string","description":"A comma-separated list of file types to hotlink protect.","example":"jpg,jpeg,gif,png,bmp"},"state":{"description":"Whether hotlink protection is enabled.\n\n* `enabled`\n* `disabled`","enum":["enabled","disabled"],"example":"disabled","type":"string"},"urls":{"type":"array","items":{"type":"string","example":"http://example.com/","format":"url"},"description":"An array of the domains with hotlink protection."},"redirect_url":{"type":"string","example":"http://redirect.example.com/","description":"The URL to which to send hotlinkers.","format":"url"},"allow_null":{"description":"Whether the domain allows hotlinks from an empty or null referral URL.\n* `1` - Allows hotlinks.\n* `0` - Does not allow hotlinks.","enum":["0","1"],"example":"1","type":"integer"}},"type":"object"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Mime","description":"The name of the module called."},"func":{"type":"string","example":"list_hotlinks","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function lists domains with hotlink protection.\n\n**Important:**\n\nWhen you **disable** the [Web Server](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"list_hotlinks","parameters":[],"summary":"Return domains with hotlink protection","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  list_hotlinks\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/list_hotlinks"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_list_hotlinks.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_list_hotlinks.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/Mime/,\n    q/list_hotlinks/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_list_hotlinks.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_list_hotlinks.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    'Mime',\n    'list_hotlinks'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mime","Direct Link Protection (Hotlink)"]}}}},"add_handler":{"paths":{"/Mime/add_handler":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  add_handler \\\n  extension='.foo' \\\n  handler='txt-foo'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/add_handler?extension=.foo&handler=txt-foo","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_add_handler.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_add_handler.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/Mime/,\n    q/add_handler/,\n    {\n        'extension' => '.foo',\n        'handler' => 'txt-foo',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_add_handler.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_add_handler.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    'Mime',\n    'add_handler',\n    array (\n        'extension' => '.foo',\n        'handler' => 'txt-foo',\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}"}],"tags":["Mime","Handler Management"],"summary":"Add web server MIME type handler","x-cpanel-api-version":"UAPI","parameters":[{"description":"The file extension.","schema":{"example":".foo","type":"string"},"name":"extension","in":"query","required":"true"},{"schema":{"type":"string","example":"txt-foo"},"description":"The Apache MIME handler.","required":"true","name":"handler","in":"query"}],"description":"This function creates an Apache MIME type handler for a file extension.\n\n**Important:**\n\nWhen you disable the [Web Server](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"add_handler","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"data":{"nullable":"true","enum":[null],"example":null,"type":"object"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"Mime","description":"The name of the module called.","type":"string"},"func":{"example":"add_handler","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42"}}},"x-tagGroups":[{"tags":["Handler Management"],"name":"Website Configuration"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mime","description":"The Mime module for UAPI."},{"name":"Handler Management","description":"Website Configuration / Handler Management"}],"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"get_redirect":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"tags":[{"description":"The Mime module for UAPI.","name":"Mime"},{"name":"Domain Redirection","description":"Domain Management / Domain Redirection"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Domain Redirection"],"name":"Domain Management"}],"paths":{"/Mime/get_redirect":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return redirect URL for domain","tags":["Mime","Domain Redirection"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  get_redirect \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/get_redirect?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_get_redirect.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_get_redirect.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/Mime/,\n    q/get_redirect/,\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_get_redirect.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_get_redirect.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    'Mime',\n    'get_redirect',\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}"}],"x-cpanel-available-version":"cPanel 88","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_redirect","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"data":{"properties":{"url":{"example":"http://www.domain.com","description":"The URL to which to the domain redirects.","format":"url","type":"string"},"redirection_enabled":{"example":"1","enum":["0","1"],"description":"Whether the domain redirects to another URL.\n* `1` - Redirects.\n* `0` - Doesn't redirect.","type":"integer"}},"type":"object"},"metadata":{"properties":{}}},"type":"object"},"module":{"description":"The name of the module called.","example":"Mime","type":"string"}},"type":"object"}}}}},"description":"This function retrieves a redirection URL for a domain.","operationId":"get_redirect","parameters":[{"name":"domain","in":"query","required":"true","description":"The domain's name.","schema":{"type":"string","example":"example.com","format":"domain"}}]}}}},"list_mime":{"paths":{"/Mime/list_mime":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"list_mime","description":"The name of the method called.","type":"string"},"module":{"example":"Mime","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* 1 - Success\n* 0 - Failed: Check the errors field for more details."},"data":{"items":{"type":"object","properties":{"type":{"description":"The MIME type.","example":"application/foo","type":"string"},"extension":{"example":".foo","description":"The file extension.","type":"string"},"origin":{"description":"The handler's owner.\n*  `system`\n*  `user`","enum":["system","user"],"example":"user","type":"string"}}},"type":"array"}},"type":"object"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"required":"true","name":"type","in":"query","schema":{"type":"string","enum":["system","user"],"example":"user"},"description":"The MIME types to list.\n* `system` — List the Apache system MIME types.\n* `user` — List the Apache user MIME types."}],"operationId":"list_mime","description":"This function lists all of Apache's MIME types.\n\n**Note:**\n\n  This function does **not** list PHP versions with MIME types when the user or domain enables PHP-FPM. The system displays **only** custom MIME types.\n\n**Important:**\n\n  When you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","x-cpanel-api-version":"UAPI","summary":"Return web server's MIME types","tags":["Mime","Mime Type Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  list_mime \\\n  type='user'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/list_mime?type=user","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_list_mime.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_list_mime.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/Mime/,\n    q/list_mime/,\n    {\n        'type' => 'user',\n    }\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_list_mime.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_list_mime.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    'Mime',\n    'list_mime',\n    array (\n        'type' => 'user',\n    )\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-tagGroups":[{"tags":["Mime Type Management"],"name":"Website Configuration"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"description":"The Mime module for UAPI.","name":"Mime"},{"description":"Website Configuration / Mime Type Management","name":"Mime Type Management"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"add_mime":{"paths":{"/Mime/add_mime":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Mime","type":"string"},"result":{"properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"data":{"nullable":"true","enum":[null],"example":null,"type":"object"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"description":"The name of the method called.","example":"add_mime","type":"string"}}}}},"description":"HTTP Request was successful."}},"operationId":"add_mime","description":"This function adds a MIME type to Apache.\n\n**Important:**\n\nWhen you disable the [Web Server](https://go.cpanel.net/serverroles) role, the system **disables** this function.","parameters":[{"in":"query","name":"type","required":"true","description":"The MIME type.","schema":{"type":"string","format":"MIME","example":"text/foo"}},{"required":"true","name":"extension","in":"query","schema":{"example":".foo","type":"string"},"description":"The file extension."}],"x-cpanel-api-version":"UAPI","summary":"Add MIME type to web server","tags":["Mime","Mime Type Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mime \\\n  add_mime \\\n  type='text/foo' \\\n  extension='.foo'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mime/add_mime?type=text%2ffoo&extension=.foo"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mime_add_mime.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mime_add_mime.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/Mime/,\n    q/add_mime/,\n    {\n        'type' => 'text/foo',\n        'extension' => '.foo',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mime_add_mime.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mime_add_mime.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    'Mime',\n    'add_mime',\n    array (\n        'type' => 'text/foo',\n        'extension' => '.foo',\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}"}]}}},"x-tagGroups":[{"tags":["Mime Type Management"],"name":"Website Configuration"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mime","description":"The Mime module for UAPI."},{"description":"Website Configuration / Mime Type Management","name":"Mime Type Management"}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}}},"EA4":{"get_recommendations":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.93.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/get_recommendations":{"get":{"parameters":[],"operationId":"get_recommendations","description":"This function retrieves a list of EasyApache 4 (EA4) configuration recommendations.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"EA4","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"example":{"ea-php55-php":[{"on":"add","options":[{"level":"success","items":["ea-apache24-mod_ruid2","ea-apache24-mod_mpm_itk"],"recommended":"true","text":"We strongly recommend that you install one of the following packages unless this is a single-user system:"},{"text":"If you use suPHP, you will add some security, but may experience performance issues on your server.","recommended":"false","level":"warning"}],"level":"danger","desc":"PHP DSO runs as the user [asis,nobody] by default. In a shared hosting environment, this is a security issue.","name":"PHP DSO","url":"https://www.example.com"}]},"type":"object","additionalProperties":{"type":"array","items":{"properties":{"level":{"description":"The level that triggers a recommendation to appear, based on [Bootstrap 3 alert components](http://getbootstrap.com/components/#alerts).\n\n* `primary`\n* `success`\n* `info`\n* `warning`\n* `danger`\n\n**Note:**\n\n* The function **only** returns this value if one exists.\n* This return's value only affects the UI if set to `danger`.","enum":["primary","success","info","warning","danger"],"type":"string"},"desc":{"type":"string","description":"The recommendation's description.\n\n**Note:**\n\nThe function **only** returns this value if one exists."},"name":{"type":"string","description":"The recommendation's name."},"url":{"format":"url","description":"A URL to provide more information.\n\n**Note:**\n\nThe function **only** returns this value if one exists.","type":"string"},"on":{"enum":["add","remove"],"description":"The action that triggers a recommendation.\n\n* `add`\n* `remove`","type":"string"},"options":{"items":{"type":"object","properties":{"url":{"format":"url","description":"A URL that provides more information.\n\n**Note:**\n\nThe function **only** returns this value if one exists.","type":"string"},"text":{"description":"The text that the user interface displays.","type":"string"},"items":{"type":"array","description":"An array of information that corresponds with a text value.\n\n**Note:**\n\nThe function **only** returns this value if one exists.","items":{"type":"string"}},"level":{"enum":["primary","success","info","warning","danger"],"description":"The level that triggers a recommendation to appear, based on [Bootstrap 3 alert components](http://getbootstrap.com/components/#alerts).\n\n* `primary`\n* `success`\n* `info`\n* `warning`\n* `danger`\n\n**Note:**\n\n* The function **only** returns this value if one exists.\n* This return's value only affects the UI if set to `danger`.","type":"string"},"recommended":{"type":"boolean","description":"The type of recommendation that the interface will return.\n\n* `true` - Recommended.\n* `false` - Not recommended.\n\n**Note:**\n\n* The function **only** returns this value if one exists.\n* If the function does **not** return this value, then the interface will display informational text."}}},"description":"An object that contains each option for the package's recommendations.","type":"array"}},"type":"object"},"description":"An object that contains recommendation information about a package.\n\n**Note:**\n\nThe function uses the name of the referenced package as the return name."}},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"description":"* `1` – Success.\n* `0` – Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"}}},"func":{"type":"string","example":"get_recommendations","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 84","tags":["EA4"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EA4 \\\n  get_recommendations\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/EA4/get_recommendations"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EA4_get_recommendations.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EA4_get_recommendations.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/EA4/,\n    q/get_recommendations/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EA4_get_recommendations.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EA4_get_recommendations.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    'EA4',\n    'get_recommendations'\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","summary":"Get EA4 configuration recommendations"}}},"x-tagGroups":[{"tags":["EA4","EasyApache Settings"],"name":"Web Server Configuration"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The EA4 module for UAPI.","name":"EA4"},{"description":"Web Server Configuration / EasyApache Settings","name":"EasyApache Settings"}]},"get_php_recommendations":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"EA4","description":"The EA4 module for UAPI."},{"description":"PHP recommendations","name":"PHP"}],"paths":{"/get_php_recommendations":{"get":{"description":"This function returns a list of recommended PHP versions.","operationId":"EA4::get_php_recommendations","parameters":[],"x-cpanel-available-version":"82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"get_php_recommendations","description":"The name of the method called."},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"data":{"type":"array","description":"An array of recommended PHP versions.","items":{"example":"php80","type":"string"}},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"EA4","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EA4 \\\n  get_php_recommendations\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/EA4/get_php_recommendations"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EA4_get_php_recommendations.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EA4_get_php_recommendations.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/EA4/,\n    q/get_php_recommendations/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EA4_get_php_recommendations.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EA4_get_php_recommendations.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    'EA4',\n    'get_php_recommendations'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["PHP"],"summary":"Get custom PHP recommendations.","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Web Server Configuration","tags":["PHP"]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"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/","version":"11.94.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}}},"StatsManager":{"get_configuration":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"StatsManager","description":"The StatsManager module for UAPI."},{"name":"Weblog Settings","description":"Statistics / Weblog Settings"}],"paths":{"/StatsManager/get_configuration":{"get":{"summary":"Returns weblog analyzers' configuration","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  StatsManager \\\n  get_configuration\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/StatsManager/get_configuration"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file StatsManager_get_configuration.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/StatsManager_get_configuration.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/StatsManager/,\n    q/get_configuration/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file StatsManager_get_configuration.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/StatsManager_get_configuration.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    'StatsManager',\n    'get_configuration'\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}"}],"tags":["StatsManager","Weblog Settings"],"x-cpanel-available-version":"90","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"StatsManager"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"},"analyzers":{"type":"array","items":{"type":"object","properties":{"enabled_by_default":{"type":"integer","enum":["1","0"],"description":"Whether the analyzer is turned on or off by default for all users.\n\n- `1` - the analyzer is enabled for all users on the server.\n- `0` - the analyzer is disabled for all users on the server."},"available_for_user":{"enum":["1","0"],"description":"Whether the analyzer can be configured by this user.\n\n- `1` - the analyzer can be configured by this user.\n- `0` - the analyzer cannot be configured by this user.","type":"integer"},"name":{"description":"Name of the analyzer.\n\nIt must be one of the following:\n\n- `analog` - Analog weblog analyzer.\n- `awstats` - AWStats weblog analyzer.\n- `webalizer` - The Webalizer weblog analyzer.","enum":["analog","awstats","webalizer"],"type":"string"}}},"description":"System configruation for each analyzer.","example":[{"available_for_user":"1","enabled_by_default":"0","name":"analog"},{"name":"awstats","enabled_by_default":"1","available_for_user":"1"},{"enabled_by_default":"0","available_for_user":"1","name":"webalizer"}]},"locked":{"type":"integer","description":"Whether the analyzer can be turned on or off for the domain by the cPanel user.\n\n- `1` - the analyzer cannot be managed by the cPanel user. The reseller or `root` controls the configuration.\n- `0` - the analyzer can be managed by the cPanel user.","enum":["1","0"]}}},"data":{"items":{"type":"object","properties":{"domain":{"type":"string","example":"domain.com","description":"The domain."},"analyzers":{"example":[{"name":"awstats","enabled_by_user":"1","enabled":"1"},{"enabled":"0","enabled_by_user":"0","name":"analog"},{"enabled":"0","enabled_by_user":"1","name":"webalizer"}],"items":{"properties":{"enabled":{"description":"Whether the analyzer is turned on or off for the domain.\n\n- `1` - the analyzer is enabled.\n- `0` - the analyzer is disabled.\n\n**Note:** This is the cumulative effect of the choices the server admin and user make.","enum":["1","0"],"type":"integer"},"enabled_by_user":{"type":"integer","enum":["1","0"],"description":"Whether the analyzer is turned on or off for the domain specifically by this user.\n\n- `1` - the analyzer is enabled by the user.\n- `0` - the analyzer is disabled by the user."},"name":{"type":"string","description":"Name of the analyzer.\n\nIt must be one of the following:\n\n- `analog` - Analog weblog analyzer.\n- `awstats` - AWStats weblog analyzer.\n- `webalizer` - The Webalizer weblog analyzer.","enum":["analog","awstats","webalizer"]}},"type":"object"},"description":"List of log analyzer configuration objects for this domain. Only analyzers that are enabled for this user on the system are shown.","type":"array"}}},"description":"A list of domains and the status of each of the web log analyzers available in cPanel for that domain.","type":"array"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"}}},"func":{"example":"get_configuration","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function lists the configuration of the web log anayzers for each domain on the cPanel account.\n\n**Important:**\n\nWhen you disable the WebServer role the system disables this function. For more information, read our How to Use [Server Profiles documentation](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/).\n\n**Note**\n\nAdditional web log analyzer configuration such as if the user can edit their own configuration is provided in the metadata section of the return.","operationId":"stats_manager_get_configuration","parameters":[]}}},"x-tagGroups":[{"tags":["Weblog Settings"],"name":"Statistics"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"save_configuration":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"StatsManager","description":"The StatsManager module for UAPI."},{"description":"Statistics / Weblog Settings","name":"Weblog Settings"}],"paths":{"/StatsManager/save_configuration":{"post":{"operationId":"stats_manager_save_configuration","description":"This function saves the users choice about which web log anayzers are enabled for each domain on their cPanel users account.\nIf the log anayzers are controlled by the reseller or root account, the user cannot manage which log analyzers are enabled or disabled.\n\n**Important:**\n\nWhen you disable the WebServer role the system disables this function. For more information, read our How to Use Server Profiles documentation.","x-cpanel-available-version":"90","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"save_configuration"},"module":{"description":"The name of the module called.","example":"StatsManager","type":"string"},"result":{"properties":{"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"type":"array","items":{"properties":{"domain":{"example":"user","description":"The domain.","type":"string"},"analyzers":{"type":"array","example":[{"available":"1","enabled":"1","name":"awstats","locked":"0"},{"enabled":"0","available":"1","locked":"0","name":"analog"},{"locked":"0","name":"webalizer","enabled":"0","available":"0"}],"items":{"properties":{"name":{"type":"string","description":"Name of the analyzer.\n\nIt must be one of the following:\n\n- `analog` - Analog weblog analyzer.\n- `awstats` - AWStats weblog analyzer.\n- `webalizer` - The Webalizer weblog analyzer.","enum":["analog","awstats","webalizer"]},"locked":{"type":"integer","description":"Whether the analyzer can be turned on or off for the domain by the cPanel user.\n\n- `1` - the analyzer can be managed by the cPanel user.\n- `0` - the analyzer cannot be managed by the cPanel user. The reseller or `root` controls the configuration.","enum":["1","0"]},"enabled":{"enum":["1","0"],"description":"Whether the analyzer is turned on or off for the domain.\n\n- `1` - the analyzer is enabled.\n- `0` - the analyzer is disabled.","type":"integer"},"available":{"type":"integer","description":"Whether the analyzer is turned on or off for the whole server.\n\n- `1` - the analyzer is enabled on the server.\n- `0` - the analyzer is disabled on the server.","enum":["1","0"]}},"type":"object"},"description":"List of log analyzer configuration objects for this domain"}},"type":"object"},"description":"A list of domains and the status of each of the web log analyzers available in cPanel for that domain."},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"echo '{\"changes\":[{\"analyzers\":[{\"enabled\":\"1\",\"name\":\"awstats\"},{\"enabled\":\"0\",\"name\":\"analog\"},{\"enabled\":\"0\",\"name\":\"webalizer\"}],\"domain\":\"domain.com\"}]}' | \\\nuapi --input=json --output=jsonpretty \\\n  --user=username \\\n  StatsManager \\\n  save_configuration","label":"CLI","lang":"Shell"},{"source":"POST /cpsess##########/execute/StatsManager/save_configuration HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 151\n\n{\"changes\":[{\"analyzers\":[{\"enabled\":\"1\",\"name\":\"awstats\"},{\"enabled\":\"0\",\"name\":\"analog\"},{\"enabled\":\"0\",\"name\":\"webalizer\"}],\"domain\":\"domain.com\"}]}","lang":"HTTP","label":"HTTP Request (Wire Format)"}],"tags":["StatsManager","Weblog Settings"],"requestBody":{"description":"List of domains and what web log analyzers to change.","content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"items":{"type":"object","properties":{"analyzers":{"type":"array","description":"List of log analyzer configuration objects.","items":{"properties":{"name":{"type":"string","enum":["analog","awstats","webalizer"],"description":"Name of the analyzer.\n\nIt must be one of the following:\n\n- `analog` - Analog weblog analyzer.\n- `awstats` - AWStats weblog analyzer.\n- `webalizer` - The Webalizer weblog analyzer."},"enabled":{"type":"integer","enum":["1","0"],"description":"Whether the analyzer is turned on or off for the domain.\n\n- `1` - the analyzer is enabled.\n- `0` - the analyzer is disabled."}},"type":"object"},"example":[{"enabled":"1","name":"awstats"},{"name":"analog","enabled":"0"},{"name":"webalizer","enabled":"0"}]},"domain":{"example":"domain.com","description":"Domain you want to configure.","type":"string"}}},"type":"array"}}}}}},"summary":"Save current user's weblog analyzers configuration","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Weblog Settings"],"name":"Statistics"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]}},"GPG":{"import_key":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"name":"Email","tags":["Signing and Encryption (GnuPG Keys)"]}],"paths":{"/GPG/import_key":{"get":{"tags":["GPG","Signing and Encryption (GnuPG Keys)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  GPG \\\n  import_key \\\n  key_data='%0A-----BEGIN%20PGP%20PUBLIC%20KEY%20BLOCK-----%0AVersion%3A%20GnuPG%20v2.0.14%20(GNU%2FLinux)%0A%0AmQENBFN0%2BOsBCADoFvyf8gHIKZ%2F%2B5KwbWb3Ht%2Fz1ukyQqFNGpBVIqHossmjmyF9e%0APn6iiZ0fHnt7r6XGGXaP%2BKKjIxAcqOTiFiP%2BHIx6GQubzVih6Ol0YNjzmK%2Ft4f%2B4%0AfSElEVnyzeyJa4LmC%2Fui%2FvvtptJ8JX6su7f11BwUTSyuqnk204AfN5uVpAcZNPT0%0A0qNNky1bxYvPUxU6Imvi1q3NtpFzqsQ4u%2FyZuLpUe7uwmgMPeO0lAms1kCa3Guot%0A3mfSt0vrUAMdcV4drY1FGtYZdYSa4rSTzpFuB7o9Ze%2BE3fUbCWs1%2B0FiN3JQNGO1%0AS2lnqjEqbpz2nHtA50elJRGqxZLEi8zkFqlTABEBAAG0Z2NQYW5lbCBTZWN1cml0%0AeSBUZWFtIC0gVEVTVCAoVEhJUyBJUyBBIFRFU1QgS0VZOyBETyBOT1QgVVNFIEZP%0AUiBBTllUSElORyBSRUFMISkgPHNlY3RlYW1zaXhAY3BhbmVsLm5ldD6JAT4EEwEC%0AACgFAlN0%2BOsCGwMFCQHhM4AGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEOhU%0A60c9RtoRkhMIAIe2yDKj55mGD3zbuGqxx6NNNIyiuEujw31N8yOS9BKTqGtIiK9i%0AGu4lzrzmHISKi0rjKmJdbckap7OouUoo9WR3ewjN6S5EHyjKfrrMwMzTWMPZOkTj%0A7A698X0vGc9yZ6KyBj8mM8J9duvNtRS285hfXfQxYO%2FuiyrJGBedI%2FWVZ3a7mcfq%0A7FhC8t6jU6sz9uIvYHAzywcVdmhEK5rS%2FuE%2F9e37h46jn2%2BkzlIWEe%2FYgpa%2BuWdT%0AO%2BOyqteW51LEjXLWMyP8AJEq8EoqbqKnm4Q1g0etOQ9trrkLUnPxaSwD5R6i4KLH%0AMR%2Fh7m%2FOoz8yOhUlrCGJwX7v9qDEdaYYFLQ%3D%0A%3DMEFZ%0A-----END%20PGP%20PUBLIC%20KEY%20BLOCK-----%0A'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/GPG/import_key?key_data=%250A-----BEGIN%2520PGP%2520PUBLIC%2520KEY%2520BLOCK-----%250AVersion%253A%2520GnuPG%2520v2.0.14%2520%28GNU%252FLinux%29%250A%250AmQENBFN0%252BOsBCADoFvyf8gHIKZ%252F%252B5KwbWb3Ht%252Fz1ukyQqFNGpBVIqHossmjmyF9e%250APn6iiZ0fHnt7r6XGGXaP%252BKKjIxAcqOTiFiP%252BHIx6GQubzVih6Ol0YNjzmK%252Ft4f%252B4%250AfSElEVnyzeyJa4LmC%252Fui%252FvvtptJ8JX6su7f11BwUTSyuqnk204AfN5uVpAcZNPT0%250A0qNNky1bxYvPUxU6Imvi1q3NtpFzqsQ4u%252FyZuLpUe7uwmgMPeO0lAms1kCa3Guot%250A3mfSt0vrUAMdcV4drY1FGtYZdYSa4rSTzpFuB7o9Ze%252BE3fUbCWs1%252B0FiN3JQNGO1%250AS2lnqjEqbpz2nHtA50elJRGqxZLEi8zkFqlTABEBAAG0Z2NQYW5lbCBTZWN1cml0%250AeSBUZWFtIC0gVEVTVCAoVEhJUyBJUyBBIFRFU1QgS0VZOyBETyBOT1QgVVNFIEZP%250AUiBBTllUSElORyBSRUFMISkgPHNlY3RlYW1zaXhAY3BhbmVsLm5ldD6JAT4EEwEC%250AACgFAlN0%252BOsCGwMFCQHhM4AGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEOhU%250A60c9RtoRkhMIAIe2yDKj55mGD3zbuGqxx6NNNIyiuEujw31N8yOS9BKTqGtIiK9i%250AGu4lzrzmHISKi0rjKmJdbckap7OouUoo9WR3ewjN6S5EHyjKfrrMwMzTWMPZOkTj%250A7A698X0vGc9yZ6KyBj8mM8J9duvNtRS285hfXfQxYO%252FuiyrJGBedI%252FWVZ3a7mcfq%250A7FhC8t6jU6sz9uIvYHAzywcVdmhEK5rS%252FuE%252F9e37h46jn2%252BkzlIWEe%252FYgpa%252BuWdT%250AO%252BOyqteW51LEjXLWMyP8AJEq8EoqbqKnm4Q1g0etOQ9trrkLUnPxaSwD5R6i4KLH%250AMR%252Fh7m%252FOoz8yOhUlrCGJwX7v9qDEdaYYFLQ%253D%250A%253DMEFZ%250A-----END%2520PGP%2520PUBLIC%2520KEY%2520BLOCK-----%250A"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file GPG_import_key.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/GPG_import_key.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/GPG/,\n    q/import_key/,\n    {\n        'key_data' => '%0A-----BEGIN%20PGP%20PUBLIC%20KEY%20BLOCK-----%0AVersion%3A%20GnuPG%20v2.0.14%20(GNU%2FLinux)%0A%0AmQENBFN0%2BOsBCADoFvyf8gHIKZ%2F%2B5KwbWb3Ht%2Fz1ukyQqFNGpBVIqHossmjmyF9e%0APn6iiZ0fHnt7r6XGGXaP%2BKKjIxAcqOTiFiP%2BHIx6GQubzVih6Ol0YNjzmK%2Ft4f%2B4%0AfSElEVnyzeyJa4LmC%2Fui%2FvvtptJ8JX6su7f11BwUTSyuqnk204AfN5uVpAcZNPT0%0A0qNNky1bxYvPUxU6Imvi1q3NtpFzqsQ4u%2FyZuLpUe7uwmgMPeO0lAms1kCa3Guot%0A3mfSt0vrUAMdcV4drY1FGtYZdYSa4rSTzpFuB7o9Ze%2BE3fUbCWs1%2B0FiN3JQNGO1%0AS2lnqjEqbpz2nHtA50elJRGqxZLEi8zkFqlTABEBAAG0Z2NQYW5lbCBTZWN1cml0%0AeSBUZWFtIC0gVEVTVCAoVEhJUyBJUyBBIFRFU1QgS0VZOyBETyBOT1QgVVNFIEZP%0AUiBBTllUSElORyBSRUFMISkgPHNlY3RlYW1zaXhAY3BhbmVsLm5ldD6JAT4EEwEC%0AACgFAlN0%2BOsCGwMFCQHhM4AGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEOhU%0A60c9RtoRkhMIAIe2yDKj55mGD3zbuGqxx6NNNIyiuEujw31N8yOS9BKTqGtIiK9i%0AGu4lzrzmHISKi0rjKmJdbckap7OouUoo9WR3ewjN6S5EHyjKfrrMwMzTWMPZOkTj%0A7A698X0vGc9yZ6KyBj8mM8J9duvNtRS285hfXfQxYO%2FuiyrJGBedI%2FWVZ3a7mcfq%0A7FhC8t6jU6sz9uIvYHAzywcVdmhEK5rS%2FuE%2F9e37h46jn2%2BkzlIWEe%2FYgpa%2BuWdT%0AO%2BOyqteW51LEjXLWMyP8AJEq8EoqbqKnm4Q1g0etOQ9trrkLUnPxaSwD5R6i4KLH%0AMR%2Fh7m%2FOoz8yOhUlrCGJwX7v9qDEdaYYFLQ%3D%0A%3DMEFZ%0A-----END%20PGP%20PUBLIC%20KEY%20BLOCK-----%0A',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file GPG_import_key.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/GPG_import_key.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    'GPG',\n    'import_key',\n    array (\n        'key_data' => '%0A-----BEGIN%20PGP%20PUBLIC%20KEY%20BLOCK-----%0AVersion%3A%20GnuPG%20v2.0.14%20(GNU%2FLinux)%0A%0AmQENBFN0%2BOsBCADoFvyf8gHIKZ%2F%2B5KwbWb3Ht%2Fz1ukyQqFNGpBVIqHossmjmyF9e%0APn6iiZ0fHnt7r6XGGXaP%2BKKjIxAcqOTiFiP%2BHIx6GQubzVih6Ol0YNjzmK%2Ft4f%2B4%0AfSElEVnyzeyJa4LmC%2Fui%2FvvtptJ8JX6su7f11BwUTSyuqnk204AfN5uVpAcZNPT0%0A0qNNky1bxYvPUxU6Imvi1q3NtpFzqsQ4u%2FyZuLpUe7uwmgMPeO0lAms1kCa3Guot%0A3mfSt0vrUAMdcV4drY1FGtYZdYSa4rSTzpFuB7o9Ze%2BE3fUbCWs1%2B0FiN3JQNGO1%0AS2lnqjEqbpz2nHtA50elJRGqxZLEi8zkFqlTABEBAAG0Z2NQYW5lbCBTZWN1cml0%0AeSBUZWFtIC0gVEVTVCAoVEhJUyBJUyBBIFRFU1QgS0VZOyBETyBOT1QgVVNFIEZP%0AUiBBTllUSElORyBSRUFMISkgPHNlY3RlYW1zaXhAY3BhbmVsLm5ldD6JAT4EEwEC%0AACgFAlN0%2BOsCGwMFCQHhM4AGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEOhU%0A60c9RtoRkhMIAIe2yDKj55mGD3zbuGqxx6NNNIyiuEujw31N8yOS9BKTqGtIiK9i%0AGu4lzrzmHISKi0rjKmJdbckap7OouUoo9WR3ewjN6S5EHyjKfrrMwMzTWMPZOkTj%0A7A698X0vGc9yZ6KyBj8mM8J9duvNtRS285hfXfQxYO%2FuiyrJGBedI%2FWVZ3a7mcfq%0A7FhC8t6jU6sz9uIvYHAzywcVdmhEK5rS%2FuE%2F9e37h46jn2%2BkzlIWEe%2FYgpa%2BuWdT%0AO%2BOyqteW51LEjXLWMyP8AJEq8EoqbqKnm4Q1g0etOQ9trrkLUnPxaSwD5R6i4KLH%0AMR%2Fh7m%2FOoz8yOhUlrCGJwX7v9qDEdaYYFLQ%3D%0A%3DMEFZ%0A-----END%20PGP%20PUBLIC%20KEY%20BLOCK-----%0A',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Import GnuPG key","parameters":[{"description":"The key to import.\n\n**Note:**\n\nYou must URI-encode this value.","schema":{"example":"%0A-----BEGIN%20PGP%20PUBLIC%20KEY%20BLOCK-----%0AVersion%3A%20GnuPG%20v2.0.14%20(GNU%2FLinux)%0A%0AmQENBFN0%2BOsBCADoFvyf8gHIKZ%2F%2B5KwbWb3Ht%2Fz1ukyQqFNGpBVIqHossmjmyF9e%0APn6iiZ0fHnt7r6XGGXaP%2BKKjIxAcqOTiFiP%2BHIx6GQubzVih6Ol0YNjzmK%2Ft4f%2B4%0AfSElEVnyzeyJa4LmC%2Fui%2FvvtptJ8JX6su7f11BwUTSyuqnk204AfN5uVpAcZNPT0%0A0qNNky1bxYvPUxU6Imvi1q3NtpFzqsQ4u%2FyZuLpUe7uwmgMPeO0lAms1kCa3Guot%0A3mfSt0vrUAMdcV4drY1FGtYZdYSa4rSTzpFuB7o9Ze%2BE3fUbCWs1%2B0FiN3JQNGO1%0AS2lnqjEqbpz2nHtA50elJRGqxZLEi8zkFqlTABEBAAG0Z2NQYW5lbCBTZWN1cml0%0AeSBUZWFtIC0gVEVTVCAoVEhJUyBJUyBBIFRFU1QgS0VZOyBETyBOT1QgVVNFIEZP%0AUiBBTllUSElORyBSRUFMISkgPHNlY3RlYW1zaXhAY3BhbmVsLm5ldD6JAT4EEwEC%0AACgFAlN0%2BOsCGwMFCQHhM4AGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEOhU%0A60c9RtoRkhMIAIe2yDKj55mGD3zbuGqxx6NNNIyiuEujw31N8yOS9BKTqGtIiK9i%0AGu4lzrzmHISKi0rjKmJdbckap7OouUoo9WR3ewjN6S5EHyjKfrrMwMzTWMPZOkTj%0A7A698X0vGc9yZ6KyBj8mM8J9duvNtRS285hfXfQxYO%2FuiyrJGBedI%2FWVZ3a7mcfq%0A7FhC8t6jU6sz9uIvYHAzywcVdmhEK5rS%2FuE%2F9e37h46jn2%2BkzlIWEe%2FYgpa%2BuWdT%0AO%2BOyqteW51LEjXLWMyP8AJEq8EoqbqKnm4Q1g0etOQ9trrkLUnPxaSwD5R6i4KLH%0AMR%2Fh7m%2FOoz8yOhUlrCGJwX7v9qDEdaYYFLQ%3D%0A%3DMEFZ%0A-----END%20PGP%20PUBLIC%20KEY%20BLOCK-----%0A","type":"string"},"name":"key_data","in":"query","required":"true"}],"operationId":"import_key","description":"This function imports a GnuPG (GPG) key.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"GPG","type":"string"},"result":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"type":"object","properties":{"key_id":{"type":"string","example":"59E79B6904616529","description":"The key's ID."}}},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"description":"The name of the method called.","example":"import_key","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 82"}}},"tags":[{"name":"GPG","description":"The GPG module for UAPI."},{"description":"Email / Signing and Encryption (GnuPG Keys)","name":"Signing and Encryption (GnuPG Keys)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"list_secret_keys":{"tags":[{"description":"The GPG module for UAPI.","name":"GPG"},{"name":"Signing and Encryption (GnuPG Keys)","description":"Email / Signing and Encryption (GnuPG Keys)"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Signing and Encryption (GnuPG Keys)"]}],"paths":{"/GPG/list_secret_keys":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"list_secret_keys","description":"The name of the method called.","type":"string"},"module":{"example":"GPG","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` — `Success`.\n* `0` — `Failed`. Check the `errors` field for more details.","enum":["1","0"],"example":"1"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"items":{"type":"object","properties":{"id":{"description":"The key's ID.","example":"738538C1","type":"string"},"created":{"type":"integer","example":"1559238435","description":"When the function created the key.","format":"unix_timestamp"},"expires":{"description":"When the key will expire.","format":"unix_timestamp","example":"1590774435","type":"integer"},"type":{"type":"string","description":"The type of key.\n\n* `sec` is the only possible value.","example":"sec","enum":["sec"]},"user_id":{"description":"The user ID of the key. The system returns this value as a space-separated string with the following values:\n\n* The username.\n* A comment in parentheses.\n* The key's email address in angle brackets (`<>`).","example":"username (John Doe) <username@example.com>","type":"string"},"algorithm":{"description":"The key's algorithm.\n* `RSA`\n* `DSA`","enum":["RSA","DSA"],"example":"DSA","type":"string"},"bits":{"example":"2048","description":"The key's length.","multipleOf":"1024","minimum":"1024","maximum":"4096","type":"integer"}}},"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}}}}}}},"x-cpanel-available-version":"cPanel 82","parameters":[],"operationId":"list_secret_keys","description":"This function lists the GnuPG (GPG) secret keys for the currently-authenticated account.","x-cpanel-api-version":"UAPI","summary":"Return current user's GnuPG secret keys","tags":["GPG","Signing and Encryption (GnuPG Keys)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  GPG \\\n  list_secret_keys\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/GPG/list_secret_keys"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file GPG_list_secret_keys.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/GPG_list_secret_keys.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/GPG/,\n    q/list_secret_keys/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file GPG_list_secret_keys.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/GPG_list_secret_keys.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    'GPG',\n    'list_secret_keys'\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}"}]}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}}},"delete_keypair":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"openapi":"3.0.2","x-tagGroups":[{"tags":["Signing and Encryption (GnuPG Keys)"],"name":"Email"}],"paths":{"/GPG/delete_keypair":{"get":{"parameters":[{"schema":{"example":"ACFFDB37176B680D","type":"string"},"description":"The ID of the GPG key that you wish to delete.\n\n**Note:**\n\n* The function will delete **all** keys that match this ID.\n  * If you set this parameter to a public key, the function will delete the public key. \n  * If you set this parameter to a public and private key pair, the function will delete the public and private keys.\n* To obtain the desired key, call the UAPI `GPG::list_secret_keys` function.","required":"true","name":"key_id","in":"query"}],"operationId":"delete_keypair","description":"This function deletes a GnuPG (GPG) key pair.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"GPG"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null}}},"func":{"type":"string","example":"delete_keypair","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 82","tags":["GPG","Signing and Encryption (GnuPG Keys)"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  GPG \\\n  delete_keypair \\\n  key_id='ACFFDB37176B680D'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/GPG/delete_keypair?key_id=ACFFDB37176B680D","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file GPG_delete_keypair.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/GPG_delete_keypair.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/GPG/,\n    q/delete_keypair/,\n    {\n        'key_id' => 'ACFFDB37176B680D',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file GPG_delete_keypair.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/GPG_delete_keypair.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    'GPG',\n    'delete_keypair',\n    array (\n        'key_id' => 'ACFFDB37176B680D',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Delete GnuPG key pair"}}},"tags":[{"description":"The GPG module for UAPI.","name":"GPG"},{"description":"Email / Signing and Encryption (GnuPG Keys)","name":"Signing and Encryption (GnuPG Keys)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}]},"generate_key":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"name":"GPG","description":"The GPG module for UAPI."},{"name":"Signing and Encryption (GnuPG Keys)","description":"Email / Signing and Encryption (GnuPG Keys)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Signing and Encryption (GnuPG Keys)"],"name":"Email"}],"paths":{"/GPG/generate_key":{"get":{"operationId":"generate_key","description":"This function generates a GnuPG (GPG) key. The system saves the key in the user's `.gnupg` directory.\n\n**Note:**\n\nThis function uses [the system's entropy](https://en.wikipedia.org/wiki/Entropy_(computing)) to generate the key. Systems with low entropy levels may cause long generation times or timeouts.","parameters":[{"schema":{"format":"username","example":"username","type":"string"},"description":"The name of the user for whom to generate the key.","required":"true","name":"name","in":"query"},{"required":"false","in":"query","name":"comment","schema":{"example":"Username's Key","default":null,"type":"string"},"description":"A comment about the key."},{"description":"The user's email address.","schema":{"format":"email","example":"user@example.com","type":"string"},"name":"email","in":"query","required":"true"},{"name":"expire","in":"query","required":"false","description":"The desired expiration date of the key\nas a timestamp in [Unix time format](http://en.wikipedia.org/wiki/Unix_time).\n\n**Note:**\n\nThis will default to one year from the current date.","schema":{"example":"1560363242","type":"string"}},{"schema":{"type":"integer","default":"0","enum":["0","1"],"example":"0"},"description":"Whether to generate the key without an expiration date.\n\n* `0` - The key will expire.\n* `1` - The key will **not** expire.","required":"false","name":"no_expire","in":"query"},{"description":"The new key's size, in bytes.\n\n**Note:**\n\nLarge keys require more time to generate.","schema":{"minimum":"1024","type":"integer","maximum":"4096","default":"2048","example":"2048","enum":["1024","2048","3072","4096"]},"in":"query","name":"keysize","required":"false"},{"in":"query","name":"passphrase","required":"true","description":"The key's password.","schema":{"type":"string","default":null,"example":"123456luggage"}}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"GPG","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"data":{"nullable":"true","default":null,"type":"object"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"type":"integer","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{}}}},"func":{"type":"string","example":"generate_key","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  GPG \\\n  generate_key \\\n  name='username' \\\n  email='user@example.com'\n  passphrase='123456luggage'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/GPG/generate_key?name=username&email=user%40example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file GPG_generate_key.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/GPG_generate_key.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/GPG/,\n    q/generate_key/,\n    {\n        'name' => 'username',\n        'email' => 'user@example.com',\n        'passphrase' => '123456luggage',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file GPG_generate_key.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/GPG_generate_key.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    'GPG',\n    'generate_key',\n    array (\n        'name' => 'username',\n        'email' => 'user@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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["GPG","Signing and Encryption (GnuPG Keys)"],"summary":"Create GnuPG key","x-cpanel-api-version":"UAPI"}}}},"list_public_keys":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/GPG/list_public_keys":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  GPG \\\n  list_public_keys\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/GPG/list_public_keys"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file GPG_list_public_keys.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/GPG_list_public_keys.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/GPG/,\n    q/list_public_keys/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file GPG_list_public_keys.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/GPG_list_public_keys.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    'GPG',\n    'list_public_keys'\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}"}],"tags":["GPG","Signing and Encryption (GnuPG Keys)"],"summary":"Return current user's GnuPG public keys","x-cpanel-api-version":"UAPI","operationId":"list_public_keys","description":"This function lists the GnuPG (GPG) public keys for the\ncurrently-authenticated account.","parameters":[],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"list_public_keys"},"module":{"example":"GPG","description":"The name of the module called.","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"metadata":{"properties":{}},"status":{"description":"- `1` - Success\n- `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"type":"array","items":{"type":"object","properties":{"created":{"description":"The creation time for the key,\nin [Unix time format](http://en.wikipedia.org/wiki/Unix_time).","example":"1559238435","type":"string"},"id":{"example":"C801294347601B8F","description":"The key's ID.","type":"string"},"expires":{"description":"When the key will expire,\nin [Unix time format](http://en.wikipedia.org/wiki/Unix_time).\n\n**Note:**\n\nIf the key does not expire,\nthis will be an empty string.","example":"1590774435","type":"string"},"user_id":{"example":"bender (is great) <bender@example.com>","description":"The user ID of the key which consists of the following space-separated values:\n* The username.\n* The key's comment in parentheses.\n* The key's email address in angle brackets (<>).","type":"string"},"type":{"type":"string","enum":["pub"],"example":"pub","description":"The type of key.\n\n**Note:**\n\nThis will always be \"pub\" because we are listing public keys."},"bits":{"minimum":"1024","type":"integer","maximum":"4096","description":"The length of the key, in bits.","enum":["1024","2048","3072","4096"],"example":"2048"},"algorithm":{"description":"The key's algorithm.\n* RSA\n* DSA","example":"DSA","enum":["RSA","DSA"],"type":"string"}}}}}}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"name":"Email","tags":["Signing and Encryption (GnuPG Keys)"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"GPG","description":"The GPG module for UAPI."},{"name":"Signing and Encryption (GnuPG Keys)","description":"Email / Signing and Encryption (GnuPG Keys)"}]},"export_secret_key":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The GPG module for UAPI.","name":"GPG"},{"description":"Email / Signing and Encryption (GnuPG Keys)","name":"Signing and Encryption (GnuPG Keys)"}],"paths":{"/GPG/export_secret_key":{"get":{"summary":"Export GnuPG secret key","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  GPG \\\n  export_secret_key \\\n  key_id='48BEA5A16FCA746E'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/GPG/export_secret_key?key_id=48BEA5A16FCA746E"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file GPG_export_secret_key.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/GPG_export_secret_key.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/GPG/,\n    q/export_secret_key/,\n    {\n        'key_id' => '48BEA5A16FCA746E',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file GPG_export_secret_key.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/GPG_export_secret_key.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    'GPG',\n    'export_secret_key',\n    array (\n        'key_id' => '48BEA5A16FCA746E',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["GPG","Signing and Encryption (GnuPG Keys)"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"GPG","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"properties":{"key_data":{"type":"string","description":"The GPG key's contents.","example":"-----BEGIN PGP PRIVATE KEY BLOCK-----\nVersion: GnuPG v2.0.22 (GNU/Linux)\n\nlQNTBFzwFyMRCADgNf7GHvCgb2/HWBYVAzu408eXEO4ucWGfbD5c5BOHg7WBVOkh\nj+J0HYaeh9FwOXLJAzesiGtTU/HQ5wNkBbKRYR2oNEUbiefBgQhjllIGJNnFCQbD\nTcyxXjKUF4aQBw6InqzM9akVChLvGoCfom/y1fcwrQ5OQ46EEjhe9lSnj1E2DIi+\n0PvOsWeehChtn28WkmXPcl+XovfsCl5vh2RnJQeJwkSwBogA1GObj9fnPBbrIUt2\nF5JDaJ7/R8aDwV1Pg2mBmRqTBIKvx6gxEQgCL52OWCKVJfqy5oVGDl/2u0BGCaRt\n3Tnh9B14Lk8frBaOjYMtMq1Rl3rPDc3KCRnLAQC6dMNJCxIoyfeEFqj0HgwHETYn\nQNGwUaRrOGKLJbMnewf/Yq0S2R6YvMl8pDQeSExYJaqv/u2Hch6GM0f3CSvMnPSg\noB2c/h4MmhmiAbymSO5GBaM4Nx3NTNYU0JpghkTTJpucFZ8hK/aJ8PDQzBnS0zTY\nF8ZqSMFL84QB1NTd1nlJnilpKCkBC6NHUh76IyLQEsH7jgOG9L28qnLxm8bGHwaJ\nmhEH2Y859WzN9hUTZEMxdklI8uwdI+msI7md0uNYiWr5svtM+rrpU+LCZMG+nTCy\n6q0CNLXM0T0Fa642mYSqV307Ouv5rjGvfohIOo5X8ikBoEIOAQk6LX800OzzYGG4\nX75Q4irMuehEK3tId5VIRToy9MRLP6fyOVHwfhzD6Af/R2TJjIdEkEGdspuw9875\nN4z9xV2QNVNgURIOutrfeKSbb7gRLgV7TWpKWItMoEO1njzb4YqoHwcAASj4TDaT\niCYun6u12Mb97L0S3QDaD3sLk7P5sZvnO//k/YxbGISv+HGl5rSF87kVectLYpAL\nehL2EBmyxP4nxhSDOqhc0rbaqOZ+b4F1ns4NsUJjxIqQJZ+ovTqkmKnh3YbBeMAb\nsPcjyfQNmYE9qFXw17vJMm6ypNsuDIvxKCDq4QpO3/MujYX0Hg7aGOq4aWtndcL0\nPfpukTLvTA+AedMj+0QHWiP15bSxCJKqa0O62mKWnrzL0Tju8FKTwVHgRoW57GY/\nZQABALMunDJSN+b/VyFzqifGvopLxJFqA4un4WjGEY9jvJooD7e0JmJlbmRlciAo\naXMgZ3JlYXQpIDxiZW5kZXJAZXhhbXBsZS5jb20+iIEEExEIACkFAlzwFyMCGyMF\nCQHhM4AHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBIvqWhb8p0bgAlAP9f\n7rAobi4nA8AmwZSaXGFmgJLeGwuM/sBQDjSp8MJR6AEAqtxkTLaOApKAeqStWYfr\nOUoraI1BayhI/AiTZAEDhmidAj0EXPAXIxAIAOAmNwCp5CL0s33LBQn9TZmYqUBi\nwobN4iIamtzT4qKWKWDDU3QmZJAzEgzONPnfy7YaWJ282FYDwTfThTHS/53X/8rt\nIzxGRNbhKcbx9V/8diHnDMu8JudbrMaQVsEsOwUy3wPQEsw7R/H55IndqmNienzV\nmQwOcKzUeGrlSg5KirGrTAu+RpB3E9jXry3YfErmB+tJELJrwzpLhOLnyMM5Z0OB\nxSrGE8Z+kCEGNfHp7buet3/kQqFAjb9idM8Vxc78vnqOevPlIceCK8/TkETVIf/N\nmthxddKFL5DxLQg5TMvICEhKp1NYtkcvCLG1K74c/psucm+Rpmc/sTilk4sAAwUH\n/2DmCrxyFsOP77Gy1DzJow3TH7J09IWg5S3qwkh4WPmS82EHc/+4QuELf+RL2hnl\n5MAD869E+D71TkFFAIrJLwzUnGEMUuSscqxwKqCpBeBAyfTMig6hDenRfSAzsbgN\nYNHDl+0xz5txo0YdwYzmh5zeY1ysE/OQrO4Y+7tavQpufUVMycESssaPXkd6STEf\nvBNFVvKEXv+zv0L4eeEoQ+zZH4FISFnK4kfTI6BqdIJ6Qjh+di633XMwiMwKFAuE\nNyZvNLAnmQKn+AjR2dE8asbsBvmZH2wgVYjOE1VwxLnwOCBDTJhLtmzVgy5Ea6zZ\nnvkuBxHjUbkoPBDqRVLsDyMAAVIC+56gmf2bW2mDuoFFUW6KT6jorvvbmXSZHi1L\nAGhQj/Q83gRejq2g+DYiFlCIZwQYEQgADwUCXPAXIwIbDAUJAeEzgAAKCRBIvqWh\nb8p0btGLAPsFHEqEg/qrEpjFu/9B8KvBWBgqIJm9XtDgaVaaHjzR4AD/XcrEvMuc\nPVYssXICwKbDwxWEYqhpI6ms0IOob0PH8hE=\n=W2NA\n-----END PGP PRIVATE KEY BLOCK-----"}},"type":"object"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"}},"type":"object"},"func":{"description":"The name of the method called.","example":"export_secret_key","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 82","parameters":[{"description":"The ID of the GPG secret key that you wish to retrieve.","schema":{"example":"48BEA5A16FCA746E","type":"string"},"name":"key_id","in":"query","required":"true"},{"description":"The passphrase of the GPG secret key that you wish to retrieve.","schema":{"example":"whatever","type":"string"},"name":"passphrase","in":"query","required":"false"}],"description":"This function exports a GnuPG (GPG) secret key.","operationId":"export_secret_key"}}},"x-tagGroups":[{"tags":["Signing and Encryption (GnuPG Keys)"],"name":"Email"}]},"export_public_key":{"paths":{"/GPG/export_public_key":{"get":{"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  GPG \\\n  export_public_key \\\n  key_id='48BEA5A16FCA746E'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/GPG/export_public_key?key_id=48BEA5A16FCA746E","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file GPG_export_public_key.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/GPG_export_public_key.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/GPG/,\n    q/export_public_key/,\n    {\n        'key_id' => '48BEA5A16FCA746E',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file GPG_export_public_key.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/GPG_export_public_key.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    'GPG',\n    'export_public_key',\n    array (\n        'key_id' => '48BEA5A16FCA746E',\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}"}],"tags":["GPG","Signing and Encryption (GnuPG Keys)"],"summary":"Export GnuPG public key","x-cpanel-api-version":"UAPI","description":"This function exports a GnuPG (GPG) public key.","operationId":"export_public_key","parameters":[{"required":"true","name":"key_id","in":"query","schema":{"example":"48BEA5A16FCA746E","type":"string"},"description":"The ID of the GPG key."}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"data":{"type":"object","properties":{"key_data":{"description":"The GPG public key's contents.","example":"-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: GnuPG v2.0.22 (GNU/Linux)\n\nmQMuBFzwFyMRCADgNf7GHvCgb2/HWBYVAzu408eXEO4ucWGfbD5c5BOHg7WBVOkh\nj+J0HYaeh9FwOXLJAzesiGtTU/HQ5wNkBbKRYR2oNEUbiefBgQhjllIGJNnFCQbD\nTcyxXjKUF4aQBw6InqzM9akVChLvGoCfom/y1fcwrQ5OQ46EEjhe9lSnj1E2DIi+\n0PvOsWeehChtn28WkmXPcl+XovfsCl5vh2RnJQeJwkSwBogA1GObj9fnPBbrIUt2\nF5JDaJ7/R8aDwV1Pg2mBmRqTBIKvx6gxEQgCL52OWCKVJfqy5oVGDl/2u0BGCaRt\n3Tnh9B14Lk8frBaOjYMtMq1Rl3rPDc3KCRnLAQC6dMNJCxIoyfeEFqj0HgwHETYn\nQNGwUaRrOGKLJbMnewf/Yq0S2R6YvMl8pDQeSExYJaqv/u2Hch6GM0f3CSvMnPSg\noB2c/h4MmhmiAbymSO5GBaM4Nx3NTNYU0JpghkTTJpucFZ8hK/aJ8PDQzBnS0zTY\nF8ZqSMFL84QB1NTd1nlJnilpKCkBC6NHUh76IyLQEsH7jgOG9L28qnLxm8bGHwaJ\nmhEH2Y859WzN9hUTZEMxdklI8uwdI+msI7md0uNYiWr5svtM+rrpU+LCZMG+nTCy\n6q0CNLXM0T0Fa642mYSqV307Ouv5rjGvfohIOo5X8ikBoEIOAQk6LX800OzzYGG4\nX75Q4irMuehEK3tId5VIRToy9MRLP6fyOVHwfhzD6Af/R2TJjIdEkEGdspuw9875\nN4z9xV2QNVNgURIOutrfeKSbb7gRLgV7TWpKWItMoEO1njzb4YqoHwcAASj4TDaT\niCYun6u12Mb97L0S3QDaD3sLk7P5sZvnO//k/YxbGISv+HGl5rSF87kVectLYpAL\nehL2EBmyxP4nxhSDOqhc0rbaqOZ+b4F1ns4NsUJjxIqQJZ+ovTqkmKnh3YbBeMAb\nsPcjyfQNmYE9qFXw17vJMm6ypNsuDIvxKCDq4QpO3/MujYX0Hg7aGOq4aWtndcL0\nPfpukTLvTA+AedMj+0QHWiP15bSxCJKqa0O62mKWnrzL0Tju8FKTwVHgRoW57GY/\nZbQmYmVuZGVyIChpcyBncmVhdCkgPGJlbmRlckBleGFtcGxlLmNvbT6IgQQTEQgA\nKQUCXPAXIwIbIwUJAeEzgAcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEEi+\npaFvynRuACUA/1/usChuLicDwCbBlJpcYWaAkt4bC4z+wFAONKnwwlHoAQCq3GRM\nto4CkoB6pK1Zh+s5SitojUFrKEj8CJNkAQOGaLkCDQRc8BcjEAgA4CY3AKnkIvSz\nfcsFCf1NmZipQGLChs3iIhqa3NPiopYpYMNTdCZkkDMSDM40+d/LthpYnbzYVgPB\nN9OFMdL/ndf/yu0jPEZE1uEpxvH1X/x2IecMy7wm51usxpBWwSw7BTLfA9ASzDtH\n8fnkid2qY2J6fNWZDA5wrNR4auVKDkqKsatMC75GkHcT2NevLdh8SuYH60kQsmvD\nOkuE4ufIwzlnQ4HFKsYTxn6QIQY18entu563f+RCoUCNv2J0zxXFzvy+eo568+Uh\nx4Irz9OQRNUh/82a2HF10oUvkPEtCDlMy8gISEqnU1i2Ry8IsbUrvhz+my5yb5Gm\nZz+xOKWTiwADBQf/YOYKvHIWw4/vsbLUPMmjDdMfsnT0haDlLerCSHhY+ZLzYQdz\n/7hC4Qt/5EvaGeXkwAPzr0T4PvVOQUUAiskvDNScYQxS5KxyrHAqoKkF4EDJ9MyK\nDqEN6dF9IDOxuA1g0cOX7THPm3GjRh3BjOaHnN5jXKwT85Cs7hj7u1q9Cm59RUzJ\nwRKyxo9eR3pJMR+8E0VW8oRe/7O/Qvh54ShD7NkfgUhIWcriR9MjoGp0gnpCOH52\nLrfdczCIzAoUC4Q3Jm80sCeZAqf4CNHZ0TxqxuwG+ZkfbCBViM4TVXDEufA4IENM\nmEu2bNWDLkRrrNme+S4HEeNRuSg8EOpFUuwPI4hnBBgRCAAPBQJc8BcjAhsMBQkB\n4TOAAAoJEEi+paFvynRu0YsA/0rluXh9ij3Np4O/KWuL2L8zcOrJJ7mNFuw0wkpY\nfZ3NAP9ayHG+70XellsQ/E3lR8fkRwqDDRh43w7ukhJEfkcY9A==\n=yyST\n-----END PGP PUBLIC KEY BLOCK-----\n","type":"string"}}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"GPG","description":"The name of the module called.","type":"string"},"func":{"example":"export_public_key","description":"The name of the method called.","type":"string"}}}}}}}}}},"x-tagGroups":[{"name":"Email","tags":["Signing and Encryption (GnuPG Keys)"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"name":"GPG","description":"The GPG module for UAPI."},{"description":"Email / Signing and Encryption (GnuPG Keys)","name":"Signing and Encryption (GnuPG Keys)"}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}},"AuditLog":{"get_api_log":{"paths":{"/AuditLog/get_api_log":{"get":{"tags":["AuditLog"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  AuditLog \\\n  get_api_log\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/AuditLog/get_api_log","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file AuditLog_get_api_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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/AuditLog_get_api_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/AuditLog/,\n    q/get_api_log/,\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file AuditLog_get_api_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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/AuditLog_get_api_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    'AuditLog',\n    'get_api_log',\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","summary":"Retrieve cPanel account API history","description":"This function retrieves the API call history of a cPanel account.","operationId":"get_api_log","x-cpanel-internal-only":"true","parameters":[],"x-cpanel-available-version":"108","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"get_api_log","description":"The name of the method called.","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"AuditLog"},"result":{"properties":{"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"items":{"properties":{"call":{"type":"string","example":"LastLogin::get_last_or_current_logged_in_ip","description":"API module and method called."},"date_timestamp":{"type":"string","example":"2022-07-17 10:07:32 -0500","description":"Date/Timestamp","format":"ISO-8601"},"called_by":{"type":"string","description":"cPanel or team user who initiated the call.","example":"team_user"},"origin":{"type":"string","example":"UI","enum":["UI","Terminal"],"description":"Where the API was called from."},"api_version":{"type":"string","enum":["cpapi1","cpapi2","uapi"],"example":"uapi","description":"Version of API used."}}},"description":"The API call history of a cPanel account."},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API."},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"name":"cPanel Account","tags":["AuditLog"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel.","default":"cpanel-server.tld"}}}],"tags":[{"description":"The AuditLog module for UAPI.","name":"AuditLog"}],"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.107.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}}},"LangPHP":{"php_get_installed_versions":{"x-tagGroups":[{"tags":["PHP Settings"],"name":"Web Server Management"}],"paths":{"/LangPHP/php_get_installed_versions":{"get":{"operationId":"php_get_installed_versions","description":"This function lists the system's PHP versions.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"LangPHP","description":"The name of the module called."},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"type":"object","properties":{"versions":{"items":{"example":"ea-php72","type":"string"},"description":"The available PHP versions.\n\n- `ea-php72`\n- `ea-php73`\n- `ea-php74`\n-  Any custom PHP package name.","type":"array"}}},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"type":"string","example":"php_get_installed_versions","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["LangPHP","PHP Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_get_installed_versions\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_get_installed_versions","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_get_installed_versions.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_installed_versions.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/LangPHP/,\n    q/php_get_installed_versions/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_get_installed_versions.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_installed_versions.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    'LangPHP',\n    'php_get_installed_versions'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return installed PHP versions"}}},"tags":[{"name":"LangPHP","description":"The LangPHP module for UAPI."},{"description":"Web Server Management / PHP Settings","name":"PHP Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2"},"php_get_impacted_domains":{"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"LangPHP","description":"The LangPHP module for UAPI."},{"description":"Web Server Management / PHP Settings","name":"PHP Settings"}],"paths":{"/LangPHP/php_get_impacted_domains":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return domains that shared PHP configuration","tags":["LangPHP","PHP Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_get_impacted_domains\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_get_impacted_domains"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_get_impacted_domains.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_impacted_domains.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/LangPHP/,\n    q/php_get_impacted_domains/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_get_impacted_domains.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_impacted_domains.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    'LangPHP',\n    'php_get_impacted_domains'\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}","label":"LiveAPI PHP","lang":"PHP"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"LangPHP","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{}},"data":{"properties":{"domains":{"description":"The domains that obtain their PHP version from the PHP configuration. Any valid domain or subdomain.\n\n**Note:**\n\nThis function does **not** return parked domains.","items":{"type":"string","example":"example.com"},"type":"array"}},"type":"object"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"},"func":{"type":"string","description":"The name of the method called.","example":"php_get_impacted_domains"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 62","parameters":[{"required":"false","name":"system_default","in":"query","schema":{"type":"integer","enum":["1","0"],"example":"1"},"description":"Whether to return domains that inherit the system's default PHP version.\n\n* `1` - Return domains that inherit the system's default PHP version.\n* `0` - Do **not** return domains that inherit the system's default PHP version.\n\n**Note:**\n\nIf you pass this parameter with a false value and do **not** also pass the domain parameter, the function returns an error."},{"required":"false","name":"domain","in":"query","schema":{"example":"example.com","format":"domain","type":"string"},"description":"A domain on the system.\n\n**Note:**\n\n * You must pass either the `system_default` or `domain` parameters, or both.\n * You can pass this parameter multiple times.\n * You **cannot** pass the name of a parked domain."}],"operationId":"php_get_impacted_domains","description":"This function lists domains that obtain their PHP version from a specified PHP configuration.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function."}}},"x-tagGroups":[{"name":"Web Server Management","tags":["PHP Settings"]}],"openapi":"3.0.2","info":{"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/","version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"php_ini_set_user_basic_directives":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The LangPHP module for UAPI.","name":"LangPHP"},{"description":"Web Server Management / PHP Settings","name":"PHP Settings"}],"paths":{"/LangPHP/php_ini_set_user_basic_directives":{"get":{"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"php_ini_set_user_basic_directives","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{"LangPHP":{"properties":{"type":{"example":"vhost","enum":["home","vhost"],"description":"The type of `php.ini` file.\n\n* `home`\n* `vhost`","type":"string"},"path":{"description":"The absolute file path to the `php.ini` file.","format":"path","example":"/home/allthethings/public_html/php.ini","type":"string"},"phpversion":{"type":"string","example":"ea-php55","description":"The virtual host's installed version of PHP."},"vhost":{"example":"clearly.com","description":"The virtual host's name.","type":"string"}},"type":"object","description":"An object containing the virtual host's PHP directive information."}}},"data":{},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"module":{"description":"The name of the module called.","example":"LangPHP","type":"string"}},"type":"object"}}}}},"operationId":"php_ini_set_user_basic_directives","description":"This function sets the values of any basic PHP directive. The *Basic Mode* section of cPanel's\n[*MultiPHP INI Editor*](https://go.cpanel.net/whmdocsMultiPHPINIEditor) interface (*WHM >> Home >> Software >> MultiPHP INI Editor*) lists these directives.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4 with MultiPHP enabled.\n\n**Important:**\n\n  When you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"example":"vhost","enum":["home","vhost"],"type":"string"},"description":"The type of `php.ini` file.\n\n* `home`\n* `vhost`\n\n**Important:**\n\n If you set this parameter to `vhost`, you **must** also include the `vhost` parameter.","required":"true","in":"query","name":"type"},{"required":"true","in":"query","name":"directive","schema":{"type":"string"},"examples":{"single":{"value":"allow_url_fopen:0","summary":"A single PHP directive."},"multiple":{"value":"directive-1=allow_url_fopen%3A0&directive-2=upload_max_filesize%3A4M&directive-3=post_max_size","summary":"Multiple PHP directives."}},"description":"The name of a PHP directive and its value.\n\n**Note:**\n\n* To change the directive's value for multiple PHP directives, increment the parameter name. For example, the `directive-1`, `directive-2`, and `directive-3` parameters.\n* You **must** format values as `<directive>:<value>`  "},{"description":"The name of a virtual host.\n\n**Important:**\n\n If the `type` value is `vhost`, you **must** use this parameter.","schema":{"type":"string","example":"clearly.com","format":"domain"},"name":"vhost","in":"query","required":"false"}],"x-cpanel-api-version":"UAPI","summary":"Update basic PHP directives","tags":["LangPHP","PHP Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_ini_set_user_basic_directives \\\n  type='vhost' \\\n  directive='allow_url_fopen:0'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_ini_set_user_basic_directives?type=vhost&directive=allow_url_fopen%3a0","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_ini_set_user_basic_directives.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_set_user_basic_directives.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/LangPHP/,\n    q/php_ini_set_user_basic_directives/,\n    {\n        'type' => 'vhost',\n        'directive' => 'allow_url_fopen:0',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_ini_set_user_basic_directives.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_set_user_basic_directives.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    'LangPHP',\n    'php_ini_set_user_basic_directives',\n    array (\n        'type' => 'vhost',\n        'directive' => 'allow_url_fopen:0',\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"name":"Web Server Management","tags":["PHP Settings"]}]},"php_ini_get_user_basic_directives":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/LangPHP/php_ini_get_user_basic_directives":{"get":{"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_ini_get_user_basic_directives \\\n  type='vhost'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_ini_get_user_basic_directives?type=vhost","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_ini_get_user_basic_directives.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_get_user_basic_directives.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/LangPHP/,\n    q/php_ini_get_user_basic_directives/,\n    {\n        'type' => 'vhost',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_ini_get_user_basic_directives.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_get_user_basic_directives.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    'LangPHP',\n    'php_ini_get_user_basic_directives',\n    array (\n        'type' => 'vhost',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["LangPHP","PHP Settings"],"summary":"Return basic PHP directives","x-cpanel-api-version":"UAPI","parameters":[{"schema":{"type":"string","enum":["home","vhost"],"example":"vhost"},"description":"The type of `php.ini` file.\n\n- `home`\n- `vhost`\n\n**Important:**\n\n If you set this parameter to `vhost`, you **must** also include the `vhost` parameter.","required":"true","in":"query","name":"type"},{"required":"false","name":"vhost","in":"query","schema":{"type":"string","example":"clearly.com","format":"domain"},"description":"The name of a virtual host.\n\n**Important:**\n\n If the type value is `vhost`, you **must** use this parameter."}],"description":"This function lists a virtual host's basic PHP directives. The Basic Mode section of cPanel's [MultiPHP INI Editor](https://go.cpanel.net/cPanelMultiPHPINI)  interface (Home >> Software >> MultiPHP INI Editor) also lists these directives.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4 with MultiPHP enabled.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","operationId":"php_ini_get_user_basic_directives","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"php_ini_get_user_basic_directives"},"result":{"properties":{"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"properties":{"directives":{"type":"array","items":{"properties":{"default_value":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"integer"},{"type":"number"}],"example":"1","description":"The directive's default value."},"key":{"description":"The directive's name.","example":"allow_url_fopen","type":"string"},"info":{"example":"This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files using the ftp or http protocol, some extensions like zlib may register additional wrappers.","description":"The purpose of the directive.","type":"string"},"php_ini_mode":{"description":"The directive's [PHP_INI mode](http://php.net/manual/en/configuration.changes.modes.php).\n\n* `PHP_INI_SYSTEM`\n* `PHP_INI_PERDIR`\n* `PHP_INI_ALL`\n* `PHPINI_ONLY`","enum":["PHP_INI_SYSTEM","PHP_INI_PERDIR","PHP_INI_ALL","PHPINI_ONLY"],"example":"PHP_INI_SYSTEM","type":"string"},"type":{"type":"string","description":"The type of value that the directive uses.\n\n* `string`\n* `boolean`\n* `integer`\n* `float`","enum":["string","boolean","integer","float"],"example":"integer"},"value":{"example":"On","description":"The directive's current value.","type":"string"}},"type":"object"},"description":"An array of the available directives in the `php.ini` file of the selected user's PHP version."}},"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"LangPHP"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.52"}}},"x-tagGroups":[{"tags":["PHP Settings"],"name":"Web Server Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"LangPHP","description":"The LangPHP module for UAPI."},{"description":"Web Server Management / PHP Settings","name":"PHP Settings"}]},"php_get_vhost_versions":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The LangPHP module for UAPI.","name":"LangPHP"},{"description":"Web Server Management / PHP Settings","name":"PHP Settings"}],"paths":{"/LangPHP/php_get_vhost_versions":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return virtual host's PHP version","tags":["LangPHP","PHP Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_get_vhost_versions\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_get_vhost_versions"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_get_vhost_versions.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_vhost_versions.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/LangPHP/,\n    q/php_get_vhost_versions/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_get_vhost_versions.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_vhost_versions.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    'LangPHP',\n    'php_get_vhost_versions'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"LangPHP","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"data":{"type":"array","description":"An array of objects of the virtual host's suspended\nstatus, versions, virtual hosts, and accounts.\nNote: Returns a single object when using the `vhost` parameter.","items":{"properties":{"homedir":{"description":"The virtual host's home directory.","format":"path","example":"/home/blee","type":"string"},"documentroot":{"description":"The virtual host's document root.","format":"path","example":"/home/blee/public_html","type":"string"},"php_fpm_pool_parms":{"description":"An object containing the domain's PHP-FPM parameters.","properties":{"pm_max_requests":{"minimum":"1","type":"integer","description":"The maximum number of requests per pool.","example":"20"},"pm_process_idle_timeout":{"example":"10","description":"A specified time of idleness before the system kills an FPM child process.","type":"integer","minimum":"1"},"pm_max_children":{"description":"The maximum number of child pages per pool.","example":"5","type":"integer","minimum":"1"}},"type":"object"},"account_owner":{"example":"blee","format":"username","description":"The account's owner.","type":"string"},"php_fpm":{"enum":["0","1"],"example":"1","description":"Whether FPM is enabled on the virtual host.\n\n* `1` - PHP-FPM enabled.\n* `0` - PHP-FPM **not** enabled.","type":"integer"},"vhost":{"description":"The virtual host's name.","format":"domain","example":"blee.com","type":"string"},"phpversion_source":{"properties":{"domain":{}},"type":"array","items":{"properties":{"system_default":{"type":"integer","description":"Whether the virtual host uses the system's default PHP version.\n* `1` - Uses the system default PHP version.\n\n**Note:**\n\n  The function **only** returns this value if true.","example":"1","enum":["1"]},"domain":{"description":"The domain the virtual host inherits its PHP version from.","format":"domain","example":"blee.com","type":"string"}},"type":"object"},"description":"How the virtual host determines its PHP version."},"account":{"type":"string","example":"blee","format":"username","description":"The account's name."},"version":{"type":"string","description":"The virtual host's PHP version.\n* `ea-php72`\n* `ea-php73`\n* `ea-php74`\n* Any custom PHP package name.","example":"ea-php72"},"main_domain":{"type":"integer","example":"1","enum":["1","0"],"description":"Whether the virtual host is the primary domain.\n\n**Note:**\n\n* `1` - The primary domain\n* `0` - **Not** the primary domain"}},"type":"object"}},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}}}},"func":{"type":"string","description":"The name of the method called.","example":"php_get_vhost_versions"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.52","parameters":[{"schema":{"type":"string","example":"your-domain.test"},"description":"The PHP Virtual Hostname.","required":"false","name":"vhost","in":"query"}],"operationId":"php_get_vhost_versions","description":"This function returns the PHP version of every virtual host that a reseller controls.\n\nYou can get the version of a single virtual host by providing an optional `vhost` name.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4.\n\n**Important:**\n\n  When you disable the [Web Server role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function."}}},"x-tagGroups":[{"tags":["PHP Settings"],"name":"Web Server Management"}],"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"php_get_system_default_version":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface’s features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"LangPHP","description":"The LangPHP module for UAPI."},{"name":"PHP Settings","description":"Web Server Management / PHP Settings"}],"paths":{"/LangPHP/php_get_system_default_version":{"get":{"tags":["LangPHP","PHP Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_get_system_default_version\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_get_system_default_version"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_get_system_default_version.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_system_default_version.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/LangPHP/,\n    q/php_get_system_default_version/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_get_system_default_version.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_system_default_version.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    'LangPHP',\n    'php_get_system_default_version'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return default PHP version","parameters":[],"description":"This function lists the system’s default PHP version.\n\n**Important**:\n\n  When you disable the [Web Server role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"php_get_system_default_version","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"properties":{"version":{"type":"string","nullable":"true","example":"ea-php73","description":"The system’s default PHP version.\n\nPossible values include:\n  * An installed PHP package that cPanel provides. For example, `ea-php80`\n  * An installed PHP package that another vendor provides. For example, `alt-php42`\n  * `null` – This value means PHP is **not** installed. Also, the `errors` return will contain a message that indicates that PHP is not installed.\n\n**Note**:\n\n  If no default is explicitly set, the package for the newest installed version of PHP is chosen."}},"type":"object"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"LangPHP","description":"The name of the module called.","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"php_get_system_default_version"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.52"}}},"x-tagGroups":[{"name":"Web Server Management","tags":["PHP Settings"]}]},"php_ini_get_user_content":{"tags":[{"description":"The LangPHP module for UAPI.","name":"LangPHP"},{"description":"Web Server Management / PHP Settings","name":"PHP Settings"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["PHP Settings"],"name":"Web Server Management"}],"paths":{"/LangPHP/php_ini_get_user_content":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_ini_get_user_content \\\n  type='vhost'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_ini_get_user_content?type=vhost"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_ini_get_user_content.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_get_user_content.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/LangPHP/,\n    q/php_ini_get_user_content/,\n    {\n        'type' => 'vhost',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_ini_get_user_content.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_get_user_content.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    'LangPHP',\n    'php_ini_get_user_content',\n    array (\n        'type' => 'vhost',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["LangPHP","PHP Settings"],"summary":"Return virtual host's php.ini content","x-cpanel-api-version":"UAPI","description":"This function returns the contents of a virtual host's `php.ini` file.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4 with MultiPHP enabled.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","operationId":"php_ini_get_user_content","parameters":[{"schema":{"type":"string","example":"vhost"},"description":"The type of `php.ini` file.\n\n* `home`\n* `vhost`\n\n**Important:**\n\nIf you set this parameter to `vhost`, you **must** also include the `vhost` parameter.","required":"true","in":"query","name":"type"},{"schema":{"format":"domain","example":"clearly.com","type":"string"},"description":"The name of a virtual host.\n\n**Important:**\n\n If the type value is `vhost`, you **must** use this parameter.","required":"false","in":"query","name":"vhost"}],"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"php_ini_get_user_content","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"LangPHP"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"properties":{"content":{"description":"The contents of the requested user's `php.ini` file.","example":"allow_url_fopen = On\\nallow_url_include = On\\nasp_tags = Off\\ndisplay_errors = On\\nenable_dl = Off\\nfile_uploads = On\\ninclude_path = &quot;.;/path/to/php/pear&quot;\\nmax_execution_time = 30\\nmax_input_time = 60\\nmax_input_vars = 1050\\nmemory_limit = 32M\\nupload_max_filesize = 2M","type":"string"}},"type":"object"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"php_ini_get_user_paths":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"LangPHP","description":"The LangPHP module for UAPI."},{"name":"PHP Settings","description":"Web Server Management / PHP Settings"}],"paths":{"/LangPHP/php_ini_get_user_paths":{"get":{"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"data":{"type":"object","properties":{"paths":{"type":"array","items":{"properties":{"documentroot":{"description":"The virtual host's document root.","example":"/home/allthethings/public_html","type":"string"},"path":{"description":"The name of the virtual host's `php.ini` file.","example":"php.ini","type":"string"},"homedir":{"example":"/home/allthethings/","description":"The home directory.","type":"string"},"vhost":{"example":"clearly.com","description":"The name of the virtual host.","format":"domain","type":"string"},"type":{"type":"string","description":"The record's type.\n* `home`\n* `vhost`","enum":["home","vhost"],"example":"vhost"},"account":{"description":"The account's name.","example":"allthethings","type":"string"},"version":{"example":"ea-php72","description":"The default PHP version.\n- `ea-php##`, where `##` represents the major and minor versions of PHP (for example, `ea-php72` represents PHP 7.2).\n- Any custom PHP package name.","type":"string"},"main_domain":{"description":"Whether the virtual host is the account's primary domain.\n* `1` - Primary domain.\n* `0` - **Not** the primary domain.","example":"1","enum":["1","0"],"type":"integer"}},"type":"object"},"description":"An array of objects of `php.ini` file information."}}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"LangPHP"},"func":{"type":"string","example":"php_ini_get_user_paths","description":"The name of the method called."}}}}},"description":"HTTP Request was successful."}},"operationId":"php_ini_get_user_paths","description":"This function lists the `php.ini` file paths for the user's home directory and virtual host document roots.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4 with MultiPHP enabled.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return php.ini file paths","tags":["LangPHP","PHP Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_ini_get_user_paths\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_ini_get_user_paths","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_ini_get_user_paths.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_get_user_paths.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/LangPHP/,\n    q/php_ini_get_user_paths/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_ini_get_user_paths.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_get_user_paths.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    'LangPHP',\n    'php_ini_get_user_paths'\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"name":"Web Server Management","tags":["PHP Settings"]}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"php_ini_set_user_content":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"name":"LangPHP","description":"The LangPHP module for UAPI."},{"name":"PHP Settings","description":"Web Server Management / PHP Settings"}],"paths":{"/LangPHP/php_ini_set_user_content":{"get":{"operationId":"php_ini_set_user_content","description":"This function changes the contents of a virtual host's `php.ini` file.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4 with MultiPHP enabled.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","parameters":[{"schema":{"type":"string","enum":["host","vhost"],"example":"vhost"},"description":"The type of `php.ini` file.\n\n* `home`\n* `vhost`\n\n**Important:**\n\n If you set this parameter to `vhost`, you **must** also include the `vhost` parameter.","required":"true","name":"type","in":"query"},{"in":"query","name":"content","required":"true","description":"The content of the `php.ini` file to change.","schema":{"example":"%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000","type":"string"}},{"schema":{"format":"domain","example":"clearly.com","type":"string"},"description":"The name of a virtual host.\n\n**Important:**\n\n If the type value is `vhost` , you **must** use this parameter.","required":"false","name":"vhost","in":"query"}],"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"LangPHP","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"metadata":{"properties":{}},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"type":"object","nullable":"true","description":"This value will always be `null`."}}},"func":{"type":"string","description":"The name of the method called.","example":"php_ini_set_user_content"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_ini_set_user_content \\\n  type='vhost' \\\n  content='%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_ini_set_user_content?type=vhost&content=%255BPHP%255D%250D%250A%253B%2bAbout%2bphp.ini%250D%250A%253B%2bphp.ini%2bis%2bresponsible%2bfor%2bconfiguring%2bmany%2bof%2bthe%2baspects%2bof%2bPHP%2527s%2bbehavior.%250D%250Apcre.backtrack_limit%253D100000"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_ini_set_user_content.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_set_user_content.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/LangPHP/,\n    q/php_ini_set_user_content/,\n    {\n        'type' => 'vhost',\n        'content' => '%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_ini_set_user_content.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_ini_set_user_content.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    'LangPHP',\n    'php_ini_set_user_content',\n    array (\n        'type' => 'vhost',\n        'content' => '%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["LangPHP","PHP Settings"],"summary":"Update virtual host's php.ini content","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["PHP Settings"],"name":"Web Server Management"}]},"php_get_domain_handler":{"x-tagGroups":[{"name":"Web Server Management","tags":["PHP Settings"]}],"paths":{"/LangPHP/php_get_domain_handler":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"php_get_domain_handler","type":"string"},"module":{"type":"string","example":"LangPHP","description":"The name of the module called."},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"type":"object","properties":{"php_handler":{"type":"string","description":"The virtual host's PHP handler.","example":"cgi"}}},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 68","parameters":[{"description":"The type of `php.ini` file.\n\n* `home`\n* `vhost`\n\n**Important:**\n\n * If you set this parameter to `vhost`, you **must** also include the vhost parameter.\n * If you set this parameter to `home`, the system returns the system default PHP handler.","schema":{"example":"vhost","enum":["home","vhost"],"type":"string"},"in":"query","name":"type","required":"true"},{"required":"false","name":"vhost","in":"query","schema":{"type":"string","format":"domain","example":"clearly.com"},"description":"The name of a virtual host.\n\n**Important:**\n\n If the `type` value is `vhost`, you **must** use this parameter."}],"operationId":"php_get_domain_handler","description":"This function returns a PHP version's assigned PHP handler.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/howtouseserverprofiles#roles), the system disables this function. For more information, read our How to Use Server Profiles documentation.","summary":"Return PHP version's handler","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_get_domain_handler \\\n  type='vhost'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_get_domain_handler?type=vhost","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_get_domain_handler.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_domain_handler.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/LangPHP/,\n    q/php_get_domain_handler/,\n    {\n        'type' => 'vhost',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_get_domain_handler.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_get_domain_handler.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    'LangPHP',\n    'php_get_domain_handler',\n    array (\n        'type' => 'vhost',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["LangPHP","PHP Settings"]}}},"tags":[{"description":"The LangPHP module for UAPI.","name":"LangPHP"},{"description":"Web Server Management / PHP Settings","name":"PHP Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"php_set_vhost_versions":{"openapi":"3.0.2","info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"LangPHP","description":"The LangPHP module for UAPI."},{"description":"Web Server Management / PHP Settings","name":"PHP Settings"}],"paths":{"/LangPHP/php_set_vhost_versions":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update virtual host's PHP version","tags":["LangPHP","PHP Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LangPHP \\\n  php_set_vhost_versions \\\n  version='ea-php72' \\\n  vhost='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_set_vhost_versions?version=ea-php72&vhost=example.com","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LangPHP_php_set_vhost_versions.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LangPHP_php_set_vhost_versions.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/LangPHP/,\n    q/php_set_vhost_versions/,\n    {\n        'version' => 'ea-php72',\n        'vhost' => '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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LangPHP_php_set_vhost_versions.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LangPHP_php_set_vhost_versions.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    'LangPHP',\n    'php_set_vhost_versions',\n    array (\n        'version' => 'ea-php72',\n        'vhost' => '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}"}],"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"php_set_vhost_versions","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"type":"object","properties":{"vhosts":{"type":"array","items":{"format":"domain","example":"example.com","type":"string"},"description":"The names of the changed virtual hosts."}}},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"metadata":{"properties":{}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"}},"type":"object"},"module":{"example":"LangPHP","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"operationId":"php_set_vhost_versions","description":"This function sets a virtual host's PHP version.\n\n**Note:**\n\n  This document **only** applies to systems that run EasyApache 4.\n\n**Important:**\n\n  When you disable the [WebServer role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","parameters":[{"in":"query","name":"version","required":"true","description":"The PHP version of a virtual host.","schema":{"type":"string","example":"ea-php72"}},{"required":"true","name":"vhost","in":"query","schema":{"format":"domain","type":"string"},"description":"The virtual host's name.\n\n**Note:**\n\n  To change the PHP version of multiple virtual hosts, duplicate or increment the parameter name. For example, `vhost-1`, `vhost-2`, and `vhost-3`.","examples":{"single":{"summary":"Set a single vhost.","value":"example.com"},"multiple":{"value":"vhost-1=example.com&vhost-2=example2.com&vhost-3=example3.com","summary":"Set a multiple vhosts."}}}]}}},"x-tagGroups":[{"tags":["PHP Settings"],"name":"Web Server Management"}]}},"Users":{"change_password":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.129.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"description":"The Users module for UAPI.","name":"Users"},{"name":"Account Management","description":"cPanel Account / Account Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"tags":["Account Management"],"name":"cPanel Account"}],"paths":{"/Users/change_password":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Users \\\n  change_password \\\n  oldpass='MyPreviousPassword' \\\n  newpass='MyUpdatedPassword'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Users/change_password?oldpass=12346=newpass=ThisIs4It!","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Users_change_password.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Users_change_password.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/Users/,\n    q/change_password/,\n    {\n        'oldpass' => 'PreviousPassword',\n        'newpass' => 'B3tt3rP4ssw0rd!',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Users_change_password.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Users_change_password.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    'Users',\n    'change_password',\n    array (\n        'oldpass' => 'PreviousPassword',\n        'newpass' => 'B3tt3rP4ssw0rd!',\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}"}],"tags":["Users","Account Management"],"summary":"Update cPanel account password","x-cpanel-api-version":"UAPI","parameters":[{"schema":{"example":"ThisWasMyPassword!","format":"password","type":"string"},"description":"The current password.","required":"true","in":"query","name":"oldpass"},{"schema":{"example":"MyNewPassw0rd!","format":"password","type":"string"},"description":"The new password.","required":"true","in":"query","name":"newpass"},{"schema":{"type":"integer","enum":["0","1"],"example":"0","default":"0"},"description":"Whether to update the cPanel account's MySQL password.\n* `1` - Update MySQL password.\n* `0` - Do not update MySQL password.","required":"false","name":"enablemysql","in":"query"},{"description":"Whether to use Digest Authentication.\n* `1` - Use Digest Auth.\n* `0` - Do not use Digest Auth.\n\n**Note:**\n\n* Windows® Vista, Windows® 7, Windows® 8, and Windows® 10 require that you use Digest Authentication \n  in order to access your Web Disk over a clear text, unencrypted connection.","schema":{"type":"integer","default":"The previously-set value or 0","example":"0","enum":["0","1"]},"in":"query","name":"enabledigest","required":"false"}],"description":"This function updates the cPanel account's password.","operationId":"Users_change_password","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Users","type":"string"},"result":{"properties":{"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"metadata":{"properties":{}},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"nullable":"true","default":null,"type":"object"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"example":"change_password","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"116"}}}}},"WordPressSite":{"create":{"paths":{"/WordPressSite/create":{"get":{"operationId":"WordPressSite::create","description":"This function installs a WordPress site for cPanel user's primary domain.","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"WordPressSite","description":"The name of the module called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"}},"type":"object"},"func":{"example":"create","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"tags":["WordPressSite","Site Installation"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressSite \\\n  create\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressSite/create"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressSite_create.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressSite_create.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/WordPressSite/,\n    q/create/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressSite_create.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressSite_create.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    'WordPressSite',\n    'create'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Install WordPress site"}}},"x-tagGroups":[{"name":"Website Configuration","tags":["Site Installation"]}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The WordPressSite module for UAPI.","name":"WordPressSite"},{"description":"Website Configuration / Site Installation","name":"Site Installation"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"version":"11.101.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"retrieve":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.101.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"openapi":"3.0.2","x-tagGroups":[{"name":"Website Configuration","tags":["Site Information"]}],"paths":{"/WordPressSite/retrieve":{"get":{"tags":["WordPressSite","Site Information"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressSite \\\n  retrieve\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressSite/retrieve","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressSite_retrieve.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressSite_retrieve.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/WordPressSite/,\n    q/retrieve/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressSite_retrieve.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressSite_retrieve.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    'WordPressSite',\n    'retrieve'\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","summary":"Return WordPress site information","description":"This function retrieves the installation status and detailed information of the WordPress site for cPanel user's primary domain.","operationId":"WordPressSite::retrieve","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"retrieve","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"WordPressSite","type":"string"},"result":{"properties":{"data":{"items":{"properties":{"install_status":{"description":"Installation status of the WordPress site.","example":"in progress","type":"string"},"details":{"example":null,"description":"Detailed information of the WordPress site.","type":"object"}}},"description":"An object that contains the installation status and information for the WordPress site."},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1","type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}}}}}}},"tags":[{"name":"WordPressSite","description":"The WordPressSite module for UAPI."},{"name":"Site Information","description":"Website Configuration / Site Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}]}},"DirectoryPrivacy":{"delete_user":{"x-tagGroups":[{"name":"Directory Management","tags":["Directory Privacy"]}],"paths":{"/DirectoryPrivacy/delete_user":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"DirectoryPrivacy","type":"string"},"result":{"properties":{"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"example":"delete_user","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 88","parameters":[{"in":"query","name":"dir","required":"true","description":"The absolute directory path on the cPanel account from which to remove a user.","schema":{"type":"string","example":"/home/example/example.com","format":"path"}},{"name":"user","in":"query","required":"true","description":"The username to remove from the directory.","schema":{"type":"string","format":"username","example":"example1"}}],"description":"This function deletes a user who can access a protected directory on the cPanel account.","operationId":"delete_user","x-cpanel-api-version":"UAPI","summary":"Delete authorized user for protected directory","tags":["DirectoryPrivacy","Directory Privacy"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryPrivacy \\\n  delete_user \\\n  dir='/home/example/example.com' \\\n  user='example1'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryPrivacy/delete_user?dir=%2fhome%2fexample%2fexample.com&user=example1"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryPrivacy_delete_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_delete_user.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/DirectoryPrivacy/,\n    q/delete_user/,\n    {\n        'dir' => '/home/example/example.com',\n        'user' => 'example1',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryPrivacy_delete_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_delete_user.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    'DirectoryPrivacy',\n    'delete_user',\n    array (\n        'dir' => '/home/example/example.com',\n        'user' => 'example1',\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}"}]}}},"tags":[{"description":"The DirectoryPrivacy module for UAPI.","name":"DirectoryPrivacy"},{"name":"Directory Privacy","description":"Directory Management / Directory Privacy"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"list_users":{"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"paths":{"/DirectoryPrivacy/list_users":{"get":{"x-cpanel-available-version":"cPanel 88","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"list_users","description":"The name of the method called.","type":"string"},"module":{"example":"DirectoryPrivacy","description":"The name of the module called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"data":{"example":["example1","example2"],"items":{"type":"string"},"description":"list of users who can access the directory.","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function returns the users who can access a password-protected directory on the cPanel account.","operationId":"DirectoryPrivacy::list_users","parameters":[{"required":"true","name":"dir","in":"query","schema":{"format":"path","example":"/home/example/example.com","type":"string"},"description":"The password-protected directory for which to return authorized users."}],"x-cpanel-api-version":"UAPI","summary":"Return authorized users for protected directory","tags":["DirectoryPrivacy","Directory Privacy"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryPrivacy \\\n  list_users \\\n  dir='/home/example/example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryPrivacy/list_users?dir=%2fhome%2fexample%2fexample.com","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryPrivacy_list_users.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_list_users.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/DirectoryPrivacy/,\n    q/list_users/,\n    {\n        'dir' => '/home/example/example.com',\n    }\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryPrivacy_list_users.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_list_users.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    'DirectoryPrivacy',\n    'list_users',\n    array (\n        'dir' => '/home/example/example.com',\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"x-tagGroups":[{"tags":["Directory Privacy"],"name":"Directory Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"DirectoryPrivacy","description":"The DirectoryPrivacy module for UAPI."},{"name":"Directory Privacy","description":"Directory Management / Directory Privacy"}]},"configure_directory_protection":{"x-tagGroups":[{"name":"Directory Management","tags":["Directory Privacy"]}],"paths":{"/DirectoryPrivacy/configure_directory_protection":{"get":{"summary":"Enable or disable protected directory","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryPrivacy \\\n  configure_directory_protection \\\n  dir='/home/example/example.com' \\\n  enabled='1' \\\n  authname='protectandserve'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryPrivacy/configure_directory_protection?dir=%2fhome%2fexample%2fexample.com&enabled=1&authname=protectandserve","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryPrivacy_configure_directory_protection.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_configure_directory_protection.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/DirectoryPrivacy/,\n    q/configure_directory_protection/,\n    {\n        'dir' => '/home/example/example.com',\n        'enabled' => '1',\n        'authname' => 'protectandserve',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryPrivacy_configure_directory_protection.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_configure_directory_protection.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    'DirectoryPrivacy',\n    'configure_directory_protection',\n    array (\n        'dir' => '/home/example/example.com',\n        'enabled' => '1',\n        'authname' => 'protectandserve',\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}"}],"tags":["DirectoryPrivacy","Directory Privacy"],"x-cpanel-available-version":"cPanel 88","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"configure_directory_protection","description":"The name of the method called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"metadata":{"properties":{}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"properties":{"passwd_file":{"type":"string","example":"/home/example/.htpasswds/example.com/passwd","description":"The path to the directory's password file.","format":"path"},"protected":{"description":"Whether the directory uses password protection.\n* `1` - Protected.\n* `0` - **Not** protected.","example":"1","enum":["0","1"],"type":"integer"},"auth_type":{"type":"string","description":"The directory's authentication type.\n* `Basic`\n* `None`","enum":["Basic","None"],"example":"Basic"},"auth_name":{"example":"protectandserve","description":"The authentication resource name.","type":"string"}},"type":"object"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"DirectoryPrivacy"}}}}},"description":"HTTP Request was successful."}},"description":"This function enables or disables password protection for a directory on the cPanel account.","operationId":"configure_directory_protection","parameters":[{"description":"The absolute or relative directory path for which to enable or disable password protection.","schema":{"type":"string","example":"/home/example/example.com","format":"path"},"name":"dir","in":"query","required":"true"},{"description":"Whether to enable password protection for the directory.\n* `1` - Enable.\n* `0` - Disable.","schema":{"enum":["0","1"],"example":"1","type":"integer"},"name":"enabled","in":"query","required":"true"},{"description":"The name of the directory protection authorization instance.\n\n**Note:**\n\n**Only** use this parameter when you enable password protection.","schema":{"type":"string","example":"protectandserve"},"in":"query","name":"authname","required":"true"}]}}},"tags":[{"name":"DirectoryPrivacy","description":"The DirectoryPrivacy module for UAPI."},{"name":"Directory Privacy","description":"Directory Management / Directory Privacy"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"is_directory_protected":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"DirectoryPrivacy","description":"The DirectoryPrivacy module for UAPI."},{"description":"Directory Management / Directory Privacy","name":"Directory Privacy"}],"paths":{"/DirectoryPrivacy/is_directory_protected":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"DirectoryPrivacy","type":"string"},"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"properties":{"auth_type":{"type":"string","enum":["Basic","None"],"example":"Basic","description":"The directory's authentication type.\n* `Basic`\n* `None`"},"auth_name":{"example":"Protected 'example.com'","description":"The authentication resource name.","type":"string"},"protected":{"example":"1","enum":["0","1"],"description":"Whether the directory uses password protection.\n* `1` - Protected.\n* `0` - **Not** protected.","type":"integer"},"passwd_file":{"type":"string","example":"/home/example/.htpasswds/example.com/passwd","format":"path","description":"The path to the directory's password file."}},"type":"object"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"is_directory_protected","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 88","parameters":[{"required":"true","name":"dir","in":"query","schema":{"format":"path","example":"/home/example/example.com","type":"string"},"description":"The absolute directory path on the cPanel account to check for password protection."}],"operationId":"is_directory_protected","description":"This function confirms whether a directory uses password protection.","x-cpanel-api-version":"UAPI","summary":"Return whether directory uses password protection","tags":["DirectoryPrivacy","Directory Privacy"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryPrivacy \\\n  is_directory_protected \\\n  dir='/home/example/example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryPrivacy/is_directory_protected?dir=%2fhome%2fexample%2fexample.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryPrivacy_is_directory_protected.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_is_directory_protected.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/DirectoryPrivacy/,\n    q/is_directory_protected/,\n    {\n        'dir' => '/home/example/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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryPrivacy_is_directory_protected.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_is_directory_protected.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    'DirectoryPrivacy',\n    'is_directory_protected',\n    array (\n        'dir' => '/home/example/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}"}]}}},"x-tagGroups":[{"tags":["Directory Privacy"],"name":"Directory Management"}]},"add_user":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"tags":[{"name":"DirectoryPrivacy","description":"The DirectoryPrivacy module for UAPI."},{"description":"Directory Management / Directory Privacy","name":"Directory Privacy"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"Directory Management","tags":["Directory Privacy"]}],"paths":{"/DirectoryPrivacy/add_user":{"get":{"x-cpanel-available-version":"cPanel 88","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"add_user","type":"string"},"module":{"type":"string","example":"DirectoryPrivacy","description":"The name of the module called."},"result":{"properties":{"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"metadata":{"properties":{}},"data":{"default":null,"nullable":"true","type":"object"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}}}},"description":"This function adds a user who can access a protected directory on the cPanel account.","operationId":"add_user","parameters":[{"in":"query","name":"dir","required":"true","description":"The directory to add users to.","schema":{"format":"path","example":"/home/example/example.com","type":"string"}},{"name":"user","in":"query","required":"true","description":"The username of the user who can access the directory.","schema":{"type":"string","example":"example1"}},{"in":"query","name":"password","required":"true","description":"The password for the user.","schema":{"type":"string","example":"123456luggage"}}],"x-cpanel-api-version":"UAPI","summary":"Add authorized user for protected directory","tags":["DirectoryPrivacy","Directory Privacy"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryPrivacy \\\n  add_user \\\n  dir='/home/example/example.com' \\\n  user='example1' \\\n  password='123456luggage'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryPrivacy/add_user?dir=%2fhome%2fexample%2fexample.com&user=example1&password=123456luggage"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryPrivacy_add_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_add_user.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/DirectoryPrivacy/,\n    q/add_user/,\n    {\n        'dir' => '/home/example/example.com',\n        'user' => 'example1',\n        'password' => '123456luggage',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryPrivacy_add_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_add_user.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    'DirectoryPrivacy',\n    'add_user',\n    array (\n        'dir' => '/home/example/example.com',\n        'user' => 'example1',\n        'password' => '123456luggage',\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}"}]}}}},"list_directories":{"paths":{"/DirectoryPrivacy/list_directories":{"get":{"x-cpanel-available-version":"cPanel 88","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"list_directories","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"DirectoryPrivacy","description":"The name of the module called."},"result":{"properties":{"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"],"type":"integer"},"data":{"properties":{"current":{"type":"object","properties":{"path":{"type":"string","description":"The current directory's path.","format":"path","example":"/home/example/example.com"},"state":{"description":"The current subdirectory's privacy information.","properties":{"passwd_file":{"example":"/home/example/.htpasswds/example.com/passwd","description":"The absolute file path to the directory's password file.","format":"path","type":"string"},"protected":{"type":"integer","enum":["1","0"],"example":"1","description":"Whether the directory is protected.\n\n* `1` — Protected.\n* `0` — **Not** protected."},"auth_name":{"example":"protected","description":"The authentication resource name.","type":"string"},"auth_type":{"example":"Basic","enum":["Basic","None"],"description":"The directory's authentication type.\n\n* `Basic`\n* `None`","type":"string"}},"type":"object"}},"description":"The user's current directory and its privacy information."},"home":{"type":"object","properties":{"path":{"type":"string","format":"path","description":"The home directory's absolute path.","example":"/home/example"},"state":{"description":"The home directory's privacy information.","properties":{"passwd_file":{"type":"string","description":"The absolute file path to the home directory's password file.","format":"path","example":"/home/example/.htpasswds/example.com/passwd"},"auth_type":{"type":"string","description":"The home directory's authentication type.\n\n* `Basic`\n* `None`","enum":["Basic","None"],"example":"Basic"},"auth_name":{"type":"string","description":"The authentication resource name.","example":"protected"},"protected":{"type":"integer","description":"Whether the home directory is protected.\n\n* `1` — Protected.\n* `0` — **Not** protected.","example":"1","enum":["1","0"]}},"type":"object"}},"description":"The user's home directory and its privacy information."},"children":{"items":{"type":"object","properties":{"path":{"type":"string","format":"path","description":"The subdirectory's directory path.","example":"/home/example/example.com/cgi-bin"},"state":{"properties":{"protected":{"enum":["1","0"],"example":"1","description":"Whether the subdirectory is protected.\n\n* `1` — Protected.\n* `0` — **Not** protected.","type":"integer"},"auth_type":{"description":"The subdirectory's authentication type.\n\n* `Basic`\n* `None`","enum":["Basic","None"],"example":"Basic","type":"string"},"auth_name":{"type":"string","description":"The authentication resource name.","example":"Protected 'example.com'"},"passwd_file":{"format":"path","description":"The absolute file path to the subdirectory's password file.","example":"/home/example/.htpasswds/example.com/passwd","type":"string"}},"type":"object","description":"The subdirectory's privacy information."}}},"description":"An array of objects containing subdirectories and their privacy\ninformation.\n\n**Note:**\n\nThe function returns an object for each subdirectory in a directory.","type":"array"},"parent":{"description":"The parent directory of the current directory and its privacy information.","properties":{"path":{"example":"/home/example","format":"path","description":"The parent directory's absolute directory path.","type":"string"},"state":{"description":"The parent directory's privacy information.","properties":{"auth_type":{"type":"string","description":"The parent directory's authentication type.\n\n* `Basic`\n* `None`","example":"Basic","enum":["Basic","None"]},"auth_name":{"type":"string","example":"protected","description":"The authentication resource name."},"protected":{"type":"integer","example":"1","enum":["1","0"],"description":"Whether the subdirectory is protected.\n\n* `1` — Protected.\n* `0` — **Not** protected."},"passwd_file":{"example":"/home/example/.htpasswds/example.com/passwd","description":"The absolute file path to the parent directory's password file.","format":"path","type":"string"}},"type":"object"}},"type":"object"}},"type":"object"},"metadata":{"properties":{}},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}}}},"description":"This function returns the privacy status of the subdirectories in a directory.","operationId":"DirectoryPrivacy-list_directories","parameters":[{"required":"true","in":"query","name":"dir","schema":{"example":"/home/example/example.com","format":"path","type":"string"},"description":"The directory path for which to return the subdirectories' privacy information."}],"x-cpanel-api-version":"UAPI","summary":"Return privacy status of subdirectories","tags":["DirectoryPrivacy","Directory Privacy"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryPrivacy \\\n  list_directories \\\n  dir='/home/example/example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryPrivacy/list_directories?dir=%2fhome%2fexample%2fexample.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryPrivacy_list_directories.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_list_directories.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/DirectoryPrivacy/,\n    q/list_directories/,\n    {\n        'dir' => '/home/example/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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryPrivacy_list_directories.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryPrivacy_list_directories.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    'DirectoryPrivacy',\n    'list_directories',\n    array (\n        'dir' => '/home/example/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}"}]}}},"x-tagGroups":[{"tags":["Directory Privacy"],"name":"Directory Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"DirectoryPrivacy","description":"The DirectoryPrivacy module for UAPI."},{"description":"Directory Management / Directory Privacy","name":"Directory Privacy"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"}},"NVData":{"get":{"paths":{"/NVData/get":{"get":{"x-cpanel-available-version":"cPanel 11.42","parameters":[{"style":"pipeDelimited","description":"A pipe-delimited list of files to retrieve, relative to the `/home/user/.cpanel/nvdata`\ndirectory, where `user` represents the cPanel user.","required":"true","name":"names","in":"query","schema":{"type":"string","format":"path"},"explode":"false","examples":{"multiple":{"value":"names=testfile|testfile1|testfile2","summary":"Retrieve multiple files."},"single":{"summary":"Retrieve a single file.","value":"testfile"}}}],"operationId":"get","description":"This function retrieves data from a non-volatile datastore. The system stores these\nfiles in the `/home/user/.cpanel/nvdata` directory, where `user` represents the account name.\n\n**Note:**\n\nWe deprecated this function. Instead, we recommend that you use the UAPI `Personalization::get`\nfunction.","x-cpanel-api-version":"UAPI","summary":"Return non-volatile datastore's data","tags":["NVData"],"deprecated":"true","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"get","description":"The name of the method called."},"module":{"example":"NVData","description":"The name of the module called.","type":"string"},"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"items":{"type":"object","properties":{"value":{"description":"The file's contents.","example":"testvalue","type":"string"},"name":{"type":"string","description":"The file's name.","example":"testfile"}}},"description":"An array of objects containing information about the non-volatile data.","type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-internal-only":"true","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  NVData \\\n  get \\\n  names='testfile'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/NVData/get?names=testfile"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\t  \n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file NVData_get.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/NVData_get.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/NVData/,\n    q/get/,\n    {\n        'names' => 'testfile',\n    }\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\t  \n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file NVData_get.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/NVData_get.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    'NVData',\n    'get',\n    array (\n        'names' => 'testfile',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"name":"NVData","tags":["NVData"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"NVData","description":"The NVData module for UAPI."}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"set":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/NVData/set":{"get":{"x-cpanel-available-version":"cPanel 54","parameters":[{"name":"names","in":"query","required":"true","examples":{"single":{"summary":"Using a single test file.","value":"testfile1"},"multiple":{"summary":"Using multiple test files.","value":"testfile1|testfile2|testfile3"}},"description":"A pipe-separated list of the non-volatile data file names that you wish to create.","schema":{"type":"string"}},{"description":"The content that you wish to save in the non-volatile data file.\n\n**Note:**\n\nThis parameter's name is the name of a file that you listed in the `names` parameter's value.","schema":{"type":"string","example":"some_data"},"name":"file","in":"query","required":"true"}],"description":"This function creates a non-volatile datastore. The system creates the datastore in the `/home/user/.cpanel/nvdata` directory, where `user` represents the account name.\n\n**Note:**\n\nWe deprecated this function. Instead, we recommend that you use the UAPI `Personalization::set` function.","operationId":"set","x-cpanel-api-version":"UAPI","summary":"Create or update non-volatile datastore","tags":["NVData"],"deprecated":"true","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"set","description":"The name of the method called.","type":"string"},"module":{"example":"NVData","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","description":"- `1` - Success\n- `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"description":"An array of objects that contains information about the non-volatile data.","items":{"properties":{"set":{"description":"The name of the non-volatile file that you created.","example":"testfile1","type":"string"}},"type":"object"},"type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}},"type":"object"}},"type":"object"}}}}},"x-cpanel-internal-only":"true","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  NVData \\\n  set \\\n  names='testfile1' \\\n  file='some_data'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/NVData/set?names=testfile1&file=some_data"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file NVData_set.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/NVData_set.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/NVData/,\n    q/set/,\n    {\n        'names' => 'testfile1',\n        'file' => 'some_data',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\t  \n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file NVData_set.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/NVData_set.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    'NVData',\n    'set',\n    array (\n        'names' => 'testfile1',\n        'file' => 'some_data',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"name":"NVData","tags":["NVData"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The NVData module for UAPI.","name":"NVData"}]}},"ModSecurity":{"list_domains":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2","x-tagGroups":[{"tags":["ModSecurity"],"name":"Web Server Management"}],"paths":{"/ModSecurity/list_domains":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ModSecurity \\\n  list_domains\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ModSecurity/list_domains","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ModSecurity_list_domains.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ModSecurity_list_domains.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/ModSecurity/,\n    q/list_domains/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ModSecurity_list_domains.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ModSecurity_list_domains.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    'ModSecurity',\n    'list_domains'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["ModSecurity"],"summary":"Return ModSecurity domains' status","x-cpanel-api-version":"UAPI","parameters":[],"description":"This function returns ModSecurity's™ status for a cPanel account's domains.\n\n**Important:**\n\nWhen you disable the [WebServer role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"ModSecurity-list_domains","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"data":{"type":"array","items":{"type":"object","properties":{"searchhint":{"type":"string","description":"A comma-separated list of domain-related search terms.","example":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com"},"type":{"example":"main","enum":["main","sub"],"description":"The domain type.\n* `main` - A main domain.\n* `sub` - A subdomain.","type":"string"},"domain":{"example":"example.com","description":"The cPanel account's domain.","format":"domain","type":"string"},"enabled":{"description":"Whether ModSecurity is enabled for the account.\n* `1` - Enabled.\n* `0` - Disabled.","example":"1","enum":["0","1"],"type":"integer"},"dependencies":{"type":"array","description":"An array of domains that your changes to a selected domain affect.","items":{"type":"string","format":"domain"},"example":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"]}}},"example":[{"enabled":"1","dependencies":["dallas.com"],"type":"sub","searchhint":"dallas.com","domain":"dallas.example.com"},{"searchhint":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com","type":"main","domain":"example.com","dependencies":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"enabled":"1"},{"type":"sub","domain":"galveston.example.com","searchhint":"galveston.com","enabled":"1","dependencies":["galveston.com"]},{"enabled":"0","dependencies":["houston.com"],"type":"sub","searchhint":"houston.com","domain":"houston.example.com"},{"domain":"neworleans.example.com","type":"sub","searchhint":"neworleans.com","enabled":"0","dependencies":["neworleans.com"]},{"type":"sub","searchhint":"sanantonio.com","domain":"sanantonio.example.com","enabled":"0","dependencies":["sanantonio.com"]}]},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"},"modsec":{"properties":{"total_enabled":{"description":"The total number of enabled entries.","example":"3","type":"integer"},"total_disabled":{"type":"integer","example":"3","description":"The total number of disabled entries."}}}}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"ModSecurity","type":"string"},"func":{"type":"string","example":"list_domains","description":"The name of the method called."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.46"}}},"tags":[{"name":"ModSecurity","description":"The ModSecurity module for UAPI."}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"disable_domains":{"paths":{"/ModSecurity/disable_domains":{"get":{"tags":["ModSecurity"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ModSecurity \\\n  disable_domains \\\n  domains='example.com,dallas.example.com,galveston.example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/ModSecurity/disable_domains?domains=example.com%2cdallas.example.com%2cgalveston.example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ModSecurity_disable_domains.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ModSecurity_disable_domains.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/ModSecurity/,\n    q/disable_domains/,\n    {\n        'domains' => 'example.com,dallas.example.com,galveston.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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ModSecurity_disable_domains.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ModSecurity_disable_domains.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    'ModSecurity',\n    'disable_domains',\n    array (\n        'domains' => 'example.com,dallas.example.com,galveston.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}"}],"x-cpanel-api-version":"UAPI","summary":"Disable ModSecurity for selected domains","description":"This function disables ModSecurity™ on specified domains.\n\n**Important:**\n\nWhen you disable the [WebServer role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"disable_domains","parameters":[{"name":"domains","in":"query","required":"true","description":"A comma-separated list of domains that the cPanel account owns.\n\n**Important:**\n\nThe authenticated cPanel account **must** own these domains.","schema":{"example":"example.com,dallas.example.com,galveston.example.com","type":"string"}}],"x-cpanel-available-version":"cPanel 11.46","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"disable_domains","description":"The name of the method called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"oneOf":[{"type":"array","example":[{"dependencies":["dallas.com"],"enabled":"0","domain":"dallas.example.com","type":"sub","searchhint":"dallas.com"},{"dependencies":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"enabled":"0","type":"main","domain":"example.com","searchhint":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com"},{"type":"sub","domain":"galveston.example.com","searchhint":"galveston.com","dependencies":["galveston.com"],"enabled":"0"}],"items":{"type":"object","properties":{"type":{"type":"string","enum":["main","sub"],"example":"main","description":"The domain type.\n* `main` - A main domain.\n* `sub` - A subdomain."},"domain":{"type":"string","example":"example.com","description":"The cPanel account's domain.","format":"domain"},"dependencies":{"items":{"format":"domain","type":"string"},"description":"An array of domains that your changes to a selected domain affect.","example":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"type":"array"},"exception":{"type":"string","example":"An error occurred during the userdata update for domain “example.com”.","description":"An exception error message. The function only returns this value if an error occurs."},"searchhint":{"type":"string","description":"A comma-separated list of domain-related search terms.","example":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com"},"enabled":{"enum":["0","1"],"example":"1","description":"Whether ModSecurity is enabled on the domain.\n* `1` - Enabled.\n* `0` - Disabled.","type":"integer"}}}},{"properties":{"no_domains_provided":{"type":"integer","example":"1","enum":["1"],"description":"Indicates caller error on API call."}},"type":"object"},{"properties":{"invalid_domains_provided":{"type":"integer","example":"1","enum":["1"],"description":"Indicates caller error on API call."},"invalid_domains":{"type":"array","description":"List of invalid domains provided by caller.","items":{"type":"string"},"example":["example.invalid"]}},"type":"object"}]},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."}}},"module":{"example":"ModSecurity","description":"The name of the module called.","type":"string"}},"type":"object"}}}}}}}},"x-tagGroups":[{"name":"Web Server Management","tags":["ModSecurity"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"ModSecurity","description":"The ModSecurity module for UAPI."}],"info":{"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/","version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"enable_domains":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"tags":[{"description":"The ModSecurity module for UAPI.","name":"ModSecurity"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Web Server Management","tags":["ModSecurity"]}],"paths":{"/ModSecurity/enable_domains":{"get":{"x-cpanel-api-version":"UAPI","summary":"Enable ModSecurity for selected domains","tags":["ModSecurity"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ModSecurity \\\n  enable_domains \\\n  domains='example.com,dallas.example.com,galveston.example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/ModSecurity/enable_domains?domains=example.com%2cdallas.example.com%2cgalveston.example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ModSecurity_enable_domains.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ModSecurity_enable_domains.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/ModSecurity/,\n    q/enable_domains/,\n    {\n        'domains' => 'example.com,dallas.example.com,galveston.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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ModSecurity_enable_domains.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ModSecurity_enable_domains.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    'ModSecurity',\n    'enable_domains',\n    array (\n        'domains' => 'example.com,dallas.example.com,galveston.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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"ModSecurity","description":"The name of the module called."},"result":{"properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"oneOf":[{"items":{"properties":{"enabled":{"type":"integer","description":"Whether ModSecurity is enabled on the domain.\n* `1` - Enabled.\n* `0` - Disabled.","example":"1","enum":["0","1"]},"searchhint":{"description":"A comma-separated list of domain-related search terms.","example":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com","type":"string"},"exception":{"type":"string","description":"An exception error message. The function only returns this value if an error occurs.","example":"An error occurred during the userdata update for domain “example.com”."},"dependencies":{"items":{"format":"domain","type":"string"},"description":"An array of domains that your changes to a selected domain affect.","example":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"type":"array"},"type":{"description":"The domain type.\n* `main` - A main domain.\n* `sub` - A subdomain.","enum":["main","sub"],"example":"main","type":"string"},"domain":{"format":"domain","description":"The cPanel account's domain.","example":"example.com","type":"string"}},"type":"object"},"example":[{"type":"sub","domain":"dallas.example.com","searchhint":"dallas.com","dependencies":["dallas.com"],"enabled":"1"},{"domain":"example.com","type":"main","searchhint":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com","dependencies":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"enabled":"1"},{"dependencies":["galveston.com"],"enabled":"1","type":"sub","domain":"galveston.example.com","searchhint":"galveston.com"}],"type":"array"},{"type":"object","properties":{"no_domains_provided":{"type":"integer","enum":["1"],"example":"1","description":"Indicates caller error on API call."}}},{"type":"object","properties":{"invalid_domains_provided":{"description":"Indicates caller error on API call.","enum":["1"],"example":"1","type":"integer"},"invalid_domains":{"type":"array","example":["example.invalid"],"items":{"type":"string"},"description":"List of invalid domains provided by caller."}}}]},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"example":"enable_domains","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.46","parameters":[{"required":"true","name":"domains","in":"query","schema":{"type":"string","example":"example.com,dallas.example.com,galveston.example.com"},"description":"A comma-separated list of domains for which to enable ModSecurity.\n\n**Important:**\n\nThe authenticated cPanel account **must** own these domains."}],"description":"This function enables ModSecurity™ for specified domains.\n\n**Important:**\n\nWhen you disable the [WebServer role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"enable_domains"}}}},"enable_all_domains":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"name":"Web Server Management","tags":["ModSecurity"]}],"paths":{"/ModSecurity/enable_all_domains":{"get":{"tags":["ModSecurity"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ModSecurity \\\n  enable_all_domains\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ModSecurity/enable_all_domains","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ModSecurity_enable_all_domains.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ModSecurity_enable_all_domains.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/ModSecurity/,\n    q/enable_all_domains/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ModSecurity_enable_all_domains.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ModSecurity_enable_all_domains.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    'ModSecurity',\n    'enable_all_domains'\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","summary":"Enable ModSecurity for all domains","description":"This function enables ModSecurity™ on a cPanel account's domains.\n\n**Important:**\n\nWhen you disable the [WebServer role](https://go.cpanel.net/serverroles#roles), the system **disables** this function","operationId":"enable_all_domains","parameters":[],"x-cpanel-available-version":"cPanel 11.46","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"ModSecurity","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"type":"array","example":[{"type":"sub","domain":"dallas.example.com","searchhint":"dallas.com","dependencies":["dallas.com"],"enabled":"1"},{"type":"main","searchhint":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com","domain":"example.com","dependencies":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"enabled":"1"},{"type":"sub","domain":"galveston.example.com","searchhint":"galveston.com","dependencies":["galveston.com"],"enabled":"1"},{"dependencies":["houston.com"],"enabled":"1","type":"sub","searchhint":"houston.com","domain":"houston.example.com"},{"enabled":"1","dependencies":["neworleans.com"],"searchhint":"neworleans.com","type":"sub","domain":"neworleans.example.com"},{"type":"sub","domain":"sanantonio.example.com","searchhint":"sanantonio.com","dependencies":["sanantonio.com"],"enabled":"1"}],"items":{"type":"object","properties":{"searchhint":{"description":"A comma-separated list of domain-related search terms.","example":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com","type":"string"},"enabled":{"type":"integer","description":"Whether ModSecurity is enabled on the account.\n* `1` - Enabled.\n* `0` - Disabled.","example":"0","enum":["0","1"]},"type":{"type":"string","example":"main","enum":["main","sub"],"description":"The domain type.\n* `main` - A main domain.\n* `sub` - A subdomain."},"domain":{"example":"example.com","format":"domain","description":"The cPanel account's domain.","type":"string"},"dependencies":{"description":"An array of domains that your changes to a selected domain affect.","items":{"format":"domain","type":"string"},"example":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"type":"array"},"exception":{"example":"An error occurred during the userdata update for domain “example.com”.","description":"An exception error message. The function only returns this value if an error occurs.","type":"string"}}}},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}}},"func":{"type":"string","example":"enable_all_domains","description":"The name of the method called."}},"type":"object"}}}}}}}},"tags":[{"description":"The ModSecurity module for UAPI.","name":"ModSecurity"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}]},"disable_all_domains":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The ModSecurity module for UAPI.","name":"ModSecurity"}],"paths":{"/ModSecurity/disable_all_domains":{"get":{"summary":"Disable ModSecurity for all domains","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ModSecurity \\\n  disable_all_domains\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ModSecurity/disable_all_domains","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ModSecurity_disable_all_domains.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ModSecurity_disable_all_domains.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/ModSecurity/,\n    q/disable_all_domains/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ModSecurity_disable_all_domains.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ModSecurity_disable_all_domains.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    'ModSecurity',\n    'disable_all_domains'\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}"}],"tags":["ModSecurity"],"x-cpanel-available-version":"cPanel 11.46","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"disable_all_domains","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"ModSecurity","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"data":{"type":"array","items":{"type":"object","properties":{"type":{"example":"main","enum":["main","sub"],"description":"The domain type.\n* `main` - A main domain.\n* `sub` - A subdomain.","type":"string"},"domain":{"type":"string","format":"domain","description":"The cPanel account's domain.","example":"example.com"},"exception":{"example":"An error occurred during the userdata update for domain “example.com”.","description":"An exception error message. The function only returns this value if an error occurs.","type":"string"},"dependencies":{"type":"array","example":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"description":"An array of domains that your changes to a selected domain affect.","items":{"type":"string","format":"domain"}},"searchhint":{"description":"A comma-separated list of domain-related search terms.","example":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com","type":"string"},"enabled":{"description":"Whether ModSecurity is enabled on the account.\n* `1` - Enabled.\n* `0` - Disabled.","enum":["0","1"],"example":"0","type":"integer"}}},"example":[{"type":"sub","domain":"dallas.example.com","searchhint":"dallas.com","dependencies":["dallas.com"],"enabled":"0"},{"enabled":"0","dependencies":["arkansas.com","kansas.com","nevada.com","newmexico.com","texas.com"],"type":"main","domain":"example.com","searchhint":"arkansas.com,kansas.com,nevada.com,newmexico.com,texas.com"},{"searchhint":"galveston.com","type":"sub","domain":"galveston.example.com","dependencies":["galveston.com"],"enabled":"0"},{"searchhint":"houston.com","type":"sub","domain":"houston.example.com","dependencies":["houston.com"],"enabled":"0"},{"enabled":"0","dependencies":["neworleans.com"],"domain":"neworleans.example.com","type":"sub","searchhint":"neworleans.com"},{"type":"sub","domain":"sanantonio.example.com","searchhint":"sanantonio.com","dependencies":["sanantonio.com"],"enabled":"0"}]},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"}}}}},"description":"HTTP Request was successful."}},"description":"This function disables ModSecurity™ on a cPanel account's domains.\n\n**Important:**\n\nWhen you disable the [WebServer role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"disable_all_domains","parameters":[]}}},"x-tagGroups":[{"tags":["ModSecurity"],"name":"Web Server Management"}],"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"has_modsecurity_installed":{"paths":{"/ModSecurity/has_modsecurity_installed":{"get":{"x-cpanel-available-version":"cPanel 11.46","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"has_modsecurity_installed","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"type":"object","properties":{"installed":{"type":"integer","description":"Whether ModSecurity is installed on the server.\n* `1` - Installed.\n* `0` - Not installed.","enum":["0","1"],"example":"1"}}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}},"type":"object"},"module":{"description":"The name of the module called.","example":"ModSecurity","type":"string"}}}}},"description":"HTTP Request was successful."}},"description":"This function checks whether ModSecurity™ is installed on a server.\n\n**Important:**\n\nWhen you disable the [Web Server role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"has_modsecurity_installed","parameters":[],"summary":"Return ModSecurity installation status","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ModSecurity \\\n  has_modsecurity_installed\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ModSecurity/has_modsecurity_installed","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ModSecurity_has_modsecurity_installed.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ModSecurity_has_modsecurity_installed.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/ModSecurity/,\n    q/has_modsecurity_installed/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ModSecurity_has_modsecurity_installed.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ModSecurity_has_modsecurity_installed.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    'ModSecurity',\n    'has_modsecurity_installed'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["ModSecurity"]}}},"x-tagGroups":[{"name":"Web Server Management","tags":["ModSecurity"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The ModSecurity module for UAPI.","name":"ModSecurity"}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}}},"cPAddons":{"get_available_addons":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"name":"cPAddons","description":"The cPAddons module for UAPI."},{"name":"cPanel Addons (cPAddons)","description":"Optional Applications / cPanel Addons (cPAddons)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"x-tagGroups":[{"name":"Optional Applications","tags":["cPanel Addons (cPAddons)"]}],"paths":{"/cPAddons/get_available_addons":{"get":{"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"items":{"type":"object","properties":{"module":{"description":"The module's name.","example":"cPanel::Blogs::WordPress","type":"string"},"description":{"type":"string","description":"The cPAddon's name.","example":"WordPress (cPanel)"}}},"type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}}},"type":"object"},"module":{"type":"string","example":"cPAddons","description":"The name of the module called."},"func":{"example":"get_available_addons","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function lists an account's available cPAddons.","operationId":"get_available_addons","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return available cPAddons","tags":["cPAddons","cPanel Addons (cPAddons)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPAddons \\\n  get_available_addons\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/cPAddons/get_available_addons"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPAddons_get_available_addons.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPAddons_get_available_addons.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/cPAddons/,\n    q/get_available_addons/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPAddons_get_available_addons.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPAddons_get_available_addons.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    'cPAddons',\n    'get_available_addons'\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}"}]}}}},"get_instance_settings":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"tags":[{"description":"The cPAddons module for UAPI.","name":"cPAddons"},{"description":"Optional Applications / cPanel Addons (cPAddons)","name":"cPanel Addons (cPAddons)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"name":"Optional Applications","tags":["cPanel Addons (cPAddons)"]}],"paths":{"/cPAddons/get_instance_settings":{"get":{"tags":["cPAddons","cPanel Addons (cPAddons)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPAddons \\\n  get_instance_settings \\\n  unique_id='cPanel::Blogs::WordPressX.0.1486754861'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/cPAddons/get_instance_settings?unique_id=cPanel%3a%3aBlogs%3a%3aWordPressX.0.1486754861","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPAddons_get_instance_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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPAddons_get_instance_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/cPAddons/,\n    q/get_instance_settings/,\n    {\n        'unique_id' => 'cPanel::Blogs::WordPressX.0.1486754861',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPAddons_get_instance_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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPAddons_get_instance_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    'cPAddons',\n    'get_instance_settings',\n    array (\n        'unique_id' => 'cPanel::Blogs::WordPressX.0.1486754861',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Return deployed cPAddons instance's settings","parameters":[{"schema":{"example":"cPanel::Blogs::WordPressX.0.1486754861","type":"string"},"description":"The unique identifier of the cPAddon.\n\n**Note:**\n\nTo find this identifier, run the `list_addon_instances` function.","required":"true","in":"query","name":"unique_id"}],"description":"This function lists a cPAddons instance's settings.","operationId":"get_instance_settings","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"cPAddons","description":"The name of the module called.","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"type":"object","properties":{"admin_user":{"description":"The administrative user for the cPAddon instance.","type":"string"},"domain":{"type":"string","description":"The domain on which the instance is installed.","format":"domain","example":"example.com"},"db_type":{"type":"string","description":"The cPAddon instance's database type.","enum":["mysql","postgre"],"example":"mysql"},"db_user":{"description":"The cPAddon instance's database user.","example":"example_wp","type":"string"},"installdir":{"example":"/home/example/public_html/wordpress","description":"The full path of the directory in which the system deployed the cPAddon.","type":"string"},"db_name":{"description":"The cPAddon instance's database name.","example":"example_wp","type":"string"},"addon":{"type":"string","example":"cPanel::Blogs::WordPressX","description":"The name of the cPAddon in double colon-delimited form."},"url_to_install":{"type":"string","example":"http://example.com/wordpress/","description":"The URL to access the cPAddon instance.","format":"url"},"autoupdate":{"description":"Whether the system processes automatic updates for the cPAddon instance.\n* `1` - Automatic updates enabled.\n* `0` - Automatic updates disabled.","example":"0","enum":["0","1"],"type":"integer"}}},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}},"func":{"type":"string","description":"The name of the method called.","example":"get_instance_settings"}}}}}}},"x-cpanel-available-version":"cPanel 64"}}}},"list_addon_instances":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/cPAddons/list_addon_instances":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return deployed cPAddons instances","tags":["cPAddons","cPanel Addons (cPAddons)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  cPAddons \\\n  list_addon_instances\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/cPAddons/list_addon_instances","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file cPAddons_list_addon_instances.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/cPAddons_list_addon_instances.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/cPAddons/,\n    q/list_addon_instances/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file cPAddons_list_addon_instances.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/cPAddons_list_addon_instances.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    'cPAddons',\n    'list_addon_instances'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-available-version":"cPanel 64","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"list_addon_instances","description":"The name of the method called."},"module":{"description":"The name of the module called.","example":"cPAddons","type":"string"},"result":{"properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"array","items":{"properties":{"domain":{"type":"string","example":"example.com","description":"The domain on which the instance is installed."},"unique_id":{"type":"string","example":"cPanel::Blogs::WordPressX.0.1486754861","description":"The unique identifier for the cPAddon.\n\n**Note:**\n\n This identifier will not change when you change the cPAddon's settings. However, if a new instance reuses a cPaddon's instance name, the system updates the unique identifier. You can use this identifier to select a specific instance to modify. A unique identifier."},"addon":{"type":"string","description":"The name of the cPAddon in double colon-delimited form.","example":"cPanel::Blogs::WordPressX"},"instance":{"example":"cPanel::Blogs::WordPressX.0","description":"The name of the instance and the number suffix.","type":"string"},"installdir":{"example":"/home/example/public_html/wordpress","description":"The full path of the directory in which the system deployed the cPAddon.","type":"string"}},"type":"object"}},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}}}},"operationId":"list_addon_instances","description":"This function lists an account's deployed cPAddons instances.","parameters":[{"required":"false","in":"query","name":"addon","schema":{"example":"cPanel::Blogs::WordPressX","type":"string"},"description":"The cPAddon for which to return the instances data."}]}}},"x-tagGroups":[{"name":"Optional Applications","tags":["cPanel Addons (cPAddons)"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The cPAddons module for UAPI.","name":"cPAddons"},{"description":"Optional Applications / cPanel Addons (cPAddons)","name":"cPanel Addons (cPAddons)"}]}},"Variables":{"get_user_information":{"x-tagGroups":[{"tags":["Account Information"],"name":"cPanel Account"}],"paths":{"/Variables/get_user_information":{"get":{"x-cpanel-available-version":"cPanel 86","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1`  Success\n* `0`  Failed: Check the errors field for more details."},"data":{"type":"object","properties":{"home":{"description":"The user's home directory.","format":"path","example":"/home/user","type":"string"},"notify_twofactorauth_change_notification_disabled":{"description":"Whether the systems sends a notification when someone disables notifications for 2FA.\n* `1` - Notifies.\n* `0` - Doesn't notify.","enum":["0","1"],"example":"1","type":"integer"},"package_extensions":{"type":"array","items":{"type":"string"},"description":"The account's package extensions.","example":["ext1","ext2","ext3"]},"spf_enabled":{"type":"integer","description":"Whether Sender Policy Framework (SPF) is enabled.\n* `1` - Enabled.\n* `0` - Not enabled.","enum":["0","1"],"example":"1"},"database_owner":{"type":"string","description":"The owner of the account's databases.\n* `root`\n* A reseller account's username.\n* The account's username.","format":"username","example":"root"},"plan":{"example":"packagename","description":"The account's hosting package.","type":"string"},"notify_disk_limit":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the systems sends a notification when the account reaches its disk usage limit.\n* `1` - Notifies.\n* `0` - Doesn't notify."},"notify_password_change_notification_disabled":{"type":"integer","description":"Whether the systems sends a notification when someone disables notifications for password changes.\n* `1` - Notifies.\n* `0` - Doesn't notify.","example":"1","enum":["0","1"]},"bandwidth_limit":{"minimum":"0","type":"integer","example":"0","description":"The account's bandwidth limit.\n* `0` - unlimited\n* A maximum amount of bandwidth, in bytes."},"feature":{"properties":{"additionalProperties":{"example":"1","enum":["0","1"],"description":"Whether the feature is enabled.\n* `1` - Enabled.\n* `0` - Disabled.\n\n**Note:**\n\nThe feature's name is the return name.","type":"integer","x-additionalPropertiesName":"feature"}},"type":"object","description":"The available features on the account that exist in the `/var/cpanel/users/user` file`, where user represents the cPanel user.\n\n**Note:**\n\nThis object returns any custom features that the hosting provider adds to the `/var/cpanel/users/user` file.","example":{"custom_feature":"1"}},"notify_ssl_expiry":{"enum":["0","1"],"example":"1","description":"Whether the systems sends a notification when an SSL certificate on the account expires.\n* `1` - Notifies.\n* `0` - Doesn't notify.","type":"integer"},"mailbox_format":{"type":"string","example":"maildir","enum":["maildir","mbox"],"description":"The storage format that the account's mailboxes use.\n* `maildir`\n* `mbox`"},"cgi_enabled":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether CGI is enabled.\n* `1` - Enabled.\n* `0` - Not enabled."},"notify_account_login_notification_disabled":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the system sends a notification when someone disables notifications for account logins.\n* `1` - Notifies.\n* `0` - Doesn't notify."},"maximum_defer_fail_percentage":{"oneOf":[{"type":"string","enum":["unlimited"]},{"type":"integer","minimum":"0"}],"description":"The [percentage of failed or deferred email messages](https://go.cpanel.net/howtopreventspam) that the account can send per hour before outgoing mail is rate-limited.\n* `unlimited`\n* An integer value.","example":"unlimited"},"home_directory_links":{"type":"array","items":{"example":"symlink"},"description":"Any symlinks to the cPanel account's home directory. An array of one or more home directory symlinks."},"notify_autossl_expiry_coverage":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the system sends a notification when AutoSSL cannot renew a certificate because domains that fail Domain Control Validation (DCV) exist on the current certificate.\n* `1` - Notifies.\n* `0` - Doesn't notify."},"contact_email_2":{"description":"The account's alternate contact email address, if one exists.","format":"email","example":"user2@example.com","type":"string"},"notify_contact_address_change":{"example":"1","enum":["0","1"],"description":"Whether the systems sends a notification when someone changes the contact address for the account.\n* `1` - Notifies.\n* `0` - Doesn't notify.","type":"integer"},"contact_email":{"format":"email","description":"The account's contact email address.","example":"user@example.com","type":"string"},"maximum_mail_accounts":{"oneOf":[{"type":"string","enum":["unlimited"]},{"minimum":"0","type":"integer"}],"description":"The maximum number of email accounts for the account.\n* `unlimited`\n* An integer that represents a number of email accounts.","example":"0"},"notify_autossl_expiry":{"description":"Whether the system sends a notification when an AutoSSL certificate expires.\n* `1` - Notifies.\n* `0` - Doesn't notify","enum":["0","1"],"example":"1","type":"integer"},"maximum_databases":{"oneOf":[{"type":"string","enum":["unlimited"]},{"type":"integer","minimum":"0"}],"description":"The account's maximum number of SQL databases.\n* `unlimited`\n* An integer that represents a number of SQL databases.","example":"unlimited"},"cpanel_root_directory":{"type":"string","description":"The `root` directory.","format":"path","example":"/usr/local/cpanel"},"notify_account_login":{"example":"1","enum":["0","1"],"description":"Whether the system sends a notification when someone logs in to the account.\n* `1` - Notifies.\n* `0` - Doesn't notify.","type":"integer"},"dead_domains":{"items":{"example":"example.example.com","format":"domain","type":"string"},"description":"The account's inactive domains.","type":"array"},"mxcheck":{"properties":{"additionalProperties":{"type":"string","x-additionalPropertiesName":"domain","example":"local","enum":["local","remote","secondary"],"description":"The domain's MX type.\n\n* `local` - Accept mail locally for the domain.\n* `remote` - Do not accept mail locally for the domain.\n* `secondary` - Accept mail until a higher priority mail server is available.\n\n**Note:**\n\nThe return's name is the domain name."}},"type":"object","example":{"example.com":"local","example2.com":"remote"},"description":"Domains and their mail exchanger (MX) type."},"maximum_mailing_lists":{"oneOf":[{"enum":["unlimited"],"type":"string"},{"minimum":"0","type":"integer"}],"example":"unlimited","description":"The account's maximum number of mailing lists.\n* `unlimited`\n* An integer that represents a number of mailing lists."},"notify_account_authn_link":{"type":"integer","description":"Whether the systems sends a notification when someone links the account to an external authentication account.\n* `1` - Notifies.\n* `0` - Doesn't notify.","example":"1","enum":["0","1"]},"owner":{"example":"root","format":"username","description":"The account's owner.\n* `root`\n* A reseller account's username.\n* The account's username.","type":"string"},"notify_autossl_renewal_coverage":{"description":"Whether the system sends a notification when AutoSSL renews a certificate.\n* `1` - Notifies.\n* `0` - Doesn't notify.","enum":["0","1"],"example":"1","type":"integer"},"notify_password_change":{"type":"integer","description":"Whether the systems sends a notification when someone changes the account's password.\n* `1` - Notifies.\n* `0` - Doesn't notify.","example":"1","enum":["0","1"]},"notify_autossl_renewal_coverage_reduced":{"type":"integer","description":"Whether the system sends a notification when AutoSSL renews a certificate, but the new certificate lacks at least one domain that the previous certificate secured.\n* `1` - Notifies.\n* `0` - Doesn't notify.","example":"1","enum":["0","1"]},"notify_twofactorauth_change":{"example":"1","enum":["0","1"],"description":"Whether the systems sends a notification when the account's Two-Factor Authentication (2FA) credentials change.\n* `1` - Notifies.\n* `0` - Doesn't notify.","type":"integer"},"notify_account_authn_link_notification_disabled":{"enum":["0","1"],"example":"1","description":"Whether the systems sends a notification when someone disables notifications for external authentication account links.\n* `1` - Notifies.\n* `0` - Doesn't notify.","type":"integer"},"maximum_emails_per_hour":{"oneOf":[{"enum":["unlimited"],"type":"string"},{"minimum":"0","type":"integer"}],"description":"The maximum number of emails that the account can send in one hour.\n* A positive integer.\n* `0` or `unlimited` - The account can send an unlimited number of emails.","example":"unlimited"},"lang":{"example":"english","description":"The account's language.","type":"string"},"demo_mode":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether demo mode is enabled.\n* `1` - Enabled.\n* `0` - Not enabled."},"backup_enabled":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the user has backups enabled.\n* `1` - Backups enabled.\n* `0` - Backups not enabled."},"dkim_enabled":{"type":"integer","description":"Whether DomainKeys Identified Mail (DKIM) is enabled.\n* `1` - Enabled.\n* `0` - Not enabled.","example":"1","enum":["0","1"]},"feature_list":{"description":"The account's [feature list](https://go.cpanel.net/whmdocs84FeatureManager) name.","example":"feature_list","type":"string"},"disk_block_limit":{"example":"100000000","description":"The number of disk blocks for the account.\n* `0` - unlimited\n* A maximum amount of disk blocks, in kilobytes.","minimum":"0","type":"integer"},"maximum_ftp_accounts":{"example":"unlimited","description":"The account's maximum number of FTP accounts.\n* `unlimited`\n* An integer that represents a number of FTP accounts.","oneOf":[{"enum":["unlimited"],"type":"string"},{"type":"integer","minimum":"0"}]},"created_in_version":{"example":"11.94.0.0","format":"cPanel version","description":"The version of cPanel used during account creation.","type":"string"},"gid":{"type":"integer","example":"5678","description":"The account's group ID."},"legacy_backup_enabled":{"type":"integer","description":"Whether legacy backups are enabled.\n* `1` - Enabled.\n* `0` - Disabled.","enum":["0","1"],"example":"1"},"notify_contact_address_change_notification_disabled":{"description":"Whether the systems sends a notification when someone disables the notification for contact address changes.\n* `1` - Notifies.\n* `0` - Doesn't notify.","enum":["0","1"],"example":"1","type":"integer"},"shell":{"example":"/bin/bash","description":"The account's shell.","format":"path","type":"string"},"maximum_addon_domains":{"description":"The account's maximum number of addon domains.\n* `unlimited`\n* An integer that represents a number of addon domains.","example":"unlimited","oneOf":[{"enum":["unlimited"],"type":"string"},{"type":"integer","minimum":"0"}]},"maximum_subdomains":{"oneOf":[{"type":"string","enum":["unlimited"]},{"type":"integer","minimum":"0"}],"example":"unlimited","description":"The account's maximum number of subdomains.\n* `unlimited`\n* An integer that represents a number of subdomains."},"notify_autossl_renewal_uncovered_domains":{"type":"integer","description":"Whether the system sends a notification when AutoSSL renews a certificate, but the new certificate lacks at least one domain that the previous certificate secured.\n* `1` - Notifies.\n* `0` - Doesn't notify.","example":"1","enum":["0","1"]},"locale":{"type":"string","example":"en","description":"The account's default locale, a two-letter [ISO-3166 code](http://www.iso.org/iso/country_codes.htm).","format":"ISO-3166-1 (alpha-2)"},"domains":{"description":"list of the account's domains and subdomains.","items":{"type":"string","format":"domain","example":"example.com"},"type":"array"},"maximum_parked_domains":{"description":"The account's maximum number of aliases.\n* `unlimited`\n* An integer that represents a number of aliases.","example":"unlimited","oneOf":[{"type":"string","enum":["unlimited"]},{"type":"integer","minimum":"0"}]},"maximum_email_account_disk_quota":{"oneOf":[{"enum":["unlimited"],"type":"string"},{"minimum":"0","type":"integer"}],"example":"unlimited","description":"The maximum size, that the account can define when it creates an email account.\n* `unlimited`\n* An integer value, in Megabytes (MB)."},"created":{"type":"integer","description":"The account's creation date in [Unix time](http://en.wikipedia.org/wiki/Unix_time) format.","format":"unix_timestamp","example":"1432220941"},"notify_account_login_for_known_netblock":{"example":"1","enum":["0","1"],"description":"Whether the system sends a notification when a user on a known netblock logs in to the account.\n* `1` - Notifies.\n* `0` - Doesn't notify.","type":"integer"},"last_modified":{"type":"integer","example":"1416586493","description":"The most recent modification time of the `/var/cpanel/users/user` file in [Unix time format](https://en.wikipedia.org/wiki/Unix_time).\n\n**Note:**\n\n`user` represents the cPanel user.","format":"unix_timestamp"},"domain":{"description":"The account's main domain.","format":"domain","example":"example.com","type":"string"},"utf8_mailbox":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether UTF-8-encoded mailbox names are enabled for the cPanel account.\n* `1` - Enabled.\n* `0` - Not enabled."},"pushbullet_access_token":{"description":"The account's Pushbullet access token.","example":"1234567890","type":"string"},"ip":{"format":"ipv4","description":"The account's IPv4 address.","example":"192.0.2.0","type":"string"},"uid":{"example":"1234","description":"The account's user ID on the system.","type":"integer"},"theme":{"description":"The account's current theme.","example":"jupiter","type":"string"},"user":{"type":"string","description":"An existing account's username.","example":"username"},"ssl_default_key_type":{"description":"The type of key to generate for the user’s TLS certificates and CSRs.\n\n* `system` — The system’s `ssl_default_key_type` value in the [`cpanel.config` file](https://go.cpanel.net/ThecpanelconfigFile).\n* `rsa-2048` — 2,048-bit RSA.\n* `rsa-4096` — 4,096-bit RSA.\n* `ecdsa-prime256v1` — ECDSA prime256v1 (“P-256”).\n* `ecdsa-secp384r1` — ECDSA secp384r1 (“P-384”).","example":"rsa-2048","enum":["system","rsa-2048","rsa-4096","ecdsa-prime256v1","ecdsa-secp384r1"],"type":"string"},"maximum_passenger_apps":{"example":"unlimited","description":"The account's maximum number of Ruby applications.\n  * `unlimited`\n  * An integer that represents a number of applications.","oneOf":[{"type":"string","enum":["unlimited"]},{"minimum":"0","type":"integer"}]},"notify_bandwidth_limit":{"example":"1","enum":["0","1"],"description":"Whether the systems sends a notification when the account reaches its bandwidth quota.\n* `1` - Notifies.\n* `0` - Doesn't notify.","type":"integer"}}},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Variables","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"get_user_information"}},"type":"object"}}}}},"description":"This function retrieves the user's account configuration settings.","operationId":"Variables-get_user_information","parameters":[{"schema":{"example":"domain","type":"string"},"description":"The user configuration variables to retrieve. If you don't use this parameter, this function returns **all** of the user's configuration data.\n\n**Note:**\n\nTo retrieve multiple account configuration settings for a user, increment the parameter name. For example: `name-0`, `name-1`, and `name-2`.","examples":{"single":{"value":"mailbox_format","summary":"Get a single account configuration setting."},"multiple":{"summary":"Get multiple account configuration settings.","value":"name-1=mailbox_format&name-2=home&name-3=shell"}},"required":"false","in":"query","name":"name"}],"summary":"Return cPanel account's configuration settings","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Variables \\\n  get_user_information\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Variables/get_user_information"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Variables_get_user_information.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Variables_get_user_information.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/Variables/,\n    q/get_user_information/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Variables_get_user_information.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Variables_get_user_information.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    'Variables',\n    'get_user_information'\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}"}],"tags":["Variables","Account Information"]}}},"tags":[{"description":"The Variables module for UAPI.","name":"Variables"},{"description":"cPanel Account / Account Information","name":"Account Information"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"get_session_information":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"tags":[{"name":"Variables","description":"The Variables module for UAPI."},{"name":"Login Information","description":"Security / Login Information"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Security","tags":["Login Information"]}],"paths":{"/Variables/get_session_information":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Variables \\\n  get_session_information\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Variables/get_session_information","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Variables_get_session_information.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Variables_get_session_information.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/Variables/,\n    q/get_session_information/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Variables_get_session_information.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Variables_get_session_information.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    'Variables',\n    'get_session_information'\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}"}],"tags":["Variables","Login Information"],"summary":"Return web server's hostname","x-cpanel-api-version":"UAPI","parameters":[{"description":"The web server environment variable to retrieve. You can **only**\nretrieve the web server's hostname.\n\n* `host` is the only possible value.","schema":{"example":"host","enum":["host"],"default":"host","type":"string"},"in":"query","name":"name","required":"false"}],"description":"This function retrieves a web server's hostname.","operationId":"get_session_information","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_session_information"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"properties":{"host":{"type":"string","example":"example.com","description":"The web server's hostname."}},"type":"object"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Variables"}}}}}}},"x-cpanel-available-version":"cPanel 86"}}}},"get_server_information":{"tags":[{"description":"The Variables module for UAPI.","name":"Variables"},{"name":"cPanel Server Information","description":"Server Information / cPanel Server Information"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Server Information","tags":["cPanel Server Information"]}],"paths":{"/Variables/get_server_information":{"get":{"x-cpanel-available-version":"cPanel 86","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Variables","type":"string"},"result":{"type":"object","properties":{"data":{"type":"object","properties":{"file_upload_must_leave_bytes":{"type":"integer","minimum":"1","nullable":"true","example":"5","description":"The minimum filesystem quota that the system requires after a file uploads to a server."},"phpmyadmin_disable_search_info_schema":{"type":"integer","enum":["1","0"],"example":"0","description":"Whether the user can search for the phpMyAdmin information schema.\n\n* `1` - Searches are enabled.\n* `0` - Searches are **not** enabled.","nullable":"true"},"invite_sub":{"nullable":"true","enum":["1","0"],"example":"1","description":"Whether cPanel account users can send invitations to new Subaccount users via cPanel's [*User Manager*](https://go.cpanel.net/cpaneldocsUserManager) interface (*cPanel >> Home >> Preferences >> User Manager*).\n\n* `1` - Can send invitations.\n* `0` - Can't send invitations.","type":"integer"},"require_ssl":{"nullable":"true","enum":["1","0"],"example":"1","description":"Whether the system requires passwords and other sensitive information use SSL encryption.\n\n* `1` - Requires SSL.\n* `0` - Doesn't require SSL.","type":"integer"},"minimum_password_strength_mysql":{"description":"The minimum strength for MySQL or MariaDB passwords.","example":"65","nullable":"true","minimum":"0","type":"integer","maximum":"100"},"skip_bandwidth_limit_check":{"nullable":"true","description":"Whether the system automatically suspends HTTP service for accounts that exceed their bandwidth limit.\n\n* `1` - Suspends HTTP service.\n* `0` - Doesn't suspend HTTP service.","enum":["1","0"],"example":"0","type":"integer"},"allow_reset_password_for_subaccounts":{"nullable":"true","description":"Whether cPanel's [*Reset Password*](https://go.cpanel.net/resetsubaccountpass) feature is enabled for subaccounts on the account.\n\n* `1` - *Reset Password* feature enabled.\n* `0` - *Reset Password* feature not enabled.","example":"1","enum":["1","0"],"type":"integer"},"disable_spambox":{"description":"Whether Apache SpamAssassin's spam box feature is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","example":"0","enum":["1","0"],"nullable":"true","type":"integer"},"version":{"type":"string","nullable":"true","description":"The system's Linux Kernel version.","example":"3.4"},"ipv6_listen":{"nullable":"true","enum":["1","0"],"example":"0","description":"Whether the `cpsrvd` daemon and other cPanel & WHM services listen on IPv6.\n\n* `1` - Listen on IPv6.\n* `0` - Don't listen on IPv6.","type":"integer"},"awstats_browser_update":{"type":"integer","enum":["1","0"],"example":"0","description":"Whether the user can update their [AWStats](http://awstats.sourceforge.net/) software.\n\n* `1` - Can update.\n* `0` - Can't update.","nullable":"true"},"dnsadmin_app":{"type":"string","oneOf":[{"description":"The application's file path, relative to the user's home directory.","type":"string"},{"type":"string","enum":["dnsadmin","auto-detect SSL"]}],"nullable":"true","example":"dnsadmin","description":"The application that processes DNS management requests.\n\n* The value is an application's file path, relative to the user's home directory.\n* `dnsadmin`\n* `auto-detect SSL`"},"logout_redirect_url":{"type":"string","example":"https://cpanel.net","format":"url","description":"The logout redirection URL.","nullable":"true"},"local_nameserver_type":{"example":"powerdns","enum":["powerdns","bind","disabled"],"description":"The DNS nameserver's type.\n\n* `powerdns` - The PowerDNS nameserver.\n* `bind` - The bind nameserver.\n* `disabled` - Nameserver's have been disabled on this server.","nullable":"true","type":"string"},"use_mail_for_mailman_url":{"nullable":"true","description":"Whether the system prefixes Mailman URLs with mail. For example, `http://mail.domain.com/mailman`.\n\n* `1` - Prefixes Mailman URLs with the `mail.` prefix.\n* `0` - Doesn't prefix Mailman URLs with the `mail.` prefix.","example":"0","enum":["1","0"],"type":"integer"},"mysql_host":{"type":"string","oneOf":[{"format":"domain","type":"string"},{"format":"ipv4","type":"string"}],"nullable":"true","example":"localhost","description":"The MySQL or MariaDB hostname or IP address."},"minimum_password_strength":{"minimum":"0","maximum":"100","type":"integer","example":"65","description":"The minimum strength for cPanel account passwords.","nullable":"true"},"file_usage":{"nullable":"true","enum":["1","0"],"example":"0","description":"Whether file usage information displays in the cPanel *Home* interface's statistics bar.\n\n* `1` - Displays file usage information.\n* `0` - Doesn't display file usage information.","type":"integer"},"allow_unregistered_domains":{"nullable":"true","description":"Whether the system allows users to add domains they didn't register with a domain name registrar.\n\n* `1` - Allows.\n* `0` - Doesn't allow.","example":"1","enum":["1","0"],"type":"integer"},"php_upload_maximum_filesize":{"nullable":"true","description":"The maximum file size, in megabytes (MB), that a PHP script may upload.","example":"50","type":"integer","maximum":"2047","minimum":"50"},"apache_port":{"type":"string","description":"The IP address or IP address with a firewall port number that Apache uses to listen for requests and serve web pages over an unsecured connection.","example":"192.0.2.0:80","nullable":"true"},"allow_reset_password":{"nullable":"true","description":"Whether cPanel's [*Reset Password*](https://go.cpanel.net/resetsubaccountpass) feature is enabled for the account.\n\n* `1` - *Reset Password* feature enabled.\n* `0` - *Reset Password* feature not enabled.","example":"1","enum":["1","0"],"type":"integer"},"ftp_server":{"type":"string","enum":["pure-ftpd","proftpd","disabled"],"example":"disabled","description":"The FTP server.\n\n* `pure-ftpd` - The Pure-FTPD server.\n* `proftpd` - The ProFTPD FTP server.\n* `disabled` - FTP has been disabled on this server.","nullable":"true"},"email_filter_storage_directory":{"type":"string","nullable":"true","example":"/etc/vfilters","format":"path","description":"The location of the Exim email filter storage directory."},"allow_remote_domains":{"example":"1","enum":["1","0"],"description":"Whether the system allows users to create addon domains or aliases that resolve to other servers.\n\n* `1` - Allows.\n* `0` - Doesn't allow.","nullable":"true","type":"integer"},"skip_mailbox_warnings_check":{"type":"integer","nullable":"true","description":"Whether mailbox usage warnings are enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","example":"1","enum":["1","0"]},"php_system_default_version":{"type":"string","nullable":"true","description":"The system's default version of PHP.","example":"ea-php73"},"file_upload_maximum_bytes":{"maximum":"10240","type":"integer","minimum":"1","nullable":"true","example":null,"description":"The maximum file size, in megabytes (MB), that a user can upload to a server."},"awstats_reverse_dns":{"type":"integer","enum":["1","0"],"example":"0","description":"Whether the AWStats statistical analysis software interprets visitors' domain names as IP addresses.\n\n* `1` - Interprets visitors' domain names as IP addresses.\n* `0` - Doesn't interpret visitors' domain names as IP addresses.","nullable":"true"},"default_theme":{"type":"string","nullable":"true","example":"jupiter","description":"The cPanel interface's default theme."},"is_mod_userdir_enabled":{"nullable":"true","description":"Whether the [Apache `mod_userdir` Tweak](https://go.cpanel.net/whmdocsApachemod_userdirTweak) is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","enum":["1","0"],"example":"1","type":"integer"},"disable_awstats":{"nullable":"true","description":"Whether the [AWStats](http://awstats.sourceforge.net/) software is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","enum":["1","0"],"example":"0","type":"integer"},"docroots_in_public_html_only":{"type":"integer","example":"1","enum":["1","0"],"description":"Whether the system restricts users from creating addon domains and subdomains outside of their `public_html` directory.\n\n* `1` - Restricts users from creating addon domains and subdomains outside of their `public_html` directory.\n* `0` - Allows users to creating addon domains and subdomains outside of their `public_html` directory.","nullable":"true"},"cpanel_root_directory":{"type":"string","description":"The cPanel `root` directory.","format":"path","example":"/usr/local/cpanel","nullable":"true"},"mysql_version":{"type":"string","nullable":"true","example":"5.7","description":"The MySQL or MariaDB version."},"disable_webalizer":{"description":"Whether the [Webalizer](http://www.webalizer.org/) statistics program is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","enum":["1","0"],"example":"0","nullable":"true","type":"integer"},"skip_apache_clients_optimizer":{"type":"integer","example":"0","enum":["1","0"],"description":"Whether the Apache Client Optimizer is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","nullable":"true"},"php_open_basedir_home":{"type":"integer","enum":["1","0"],"example":"0","description":"Whether PHP `open_basedir` protection is enabled on the server.\n\n* `1` - Enabled.\n* `0` - Not enabled.\n\n**Important:**\n\nWe removed WHM's *PHP open_basedir Tweak* interface (*WHM >> Home >> Security Center >> PHP open_basedir Tweak*)","nullable":"true"},"api_shell":{"type":"integer","nullable":"true","enum":["1","0"],"example":"0","description":"Whether the user can access cPanel's [*API Shell*](https://go.cpanel.net/cpaneldocsAPIShell) interface (*cPanel >> Home >> Advanced >> API Shell*).\n\n* `1` - Can access.\n* `0` - Can't access."},"mail_server":{"type":"string","nullable":"true","enum":["dovecot","disabled"],"example":"dovecot","description":"The mailserver type.\n\n* `dovecot` - The Dovecot mailserver.\n* `disabled` - The mailserver is disabled on this system."},"display_cpanel_doclinks":{"type":"integer","nullable":"true","enum":["1","0"],"example":"0","description":"Whether the system displays links to cPanel feature documentation in the cPanel interface.\n\n* `1` - Displays documentation links.\n* `0` - Doesn't display documentation links."},"disable_boxtrapper":{"example":"0","enum":["1","0"],"description":"Whether [*BoxTrapper*](https://go.cpanel.net/cpaneldocsBoxTrapper) is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","nullable":"true","type":"integer"},"enable_file_protect":{"nullable":"true","description":"Whether [EasyApache 4's *FileProtect* option](https://go.cpanel.net/EasyApache4FileprotectOption) is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","enum":["1","0"],"example":"1","type":"integer"},"allow_park_subdomain_on_hostname":{"type":"integer","description":"Whether the system allows users to park subdomains of the server's hostname.\n\n* `1` - Allows.\n* `0` - Doesn't allow.","enum":["1","0"],"example":"0","nullable":"true"},"use_information_schema":{"type":"integer","nullable":"true","description":"Whether the system uses the MySQL `INFORMATION_SCHEMA` view. This view includes disk usage by all MySQL tables in the disk usage totals.\n\n* `1` - Uses MySQL's `INFORMATION_SCHEMA` view.\n* `0` - Doesn't use MySQL's `INFORMATION_SCHEMA` view.","enum":["1","0"],"example":"1"},"php_post_maximum_size":{"minimum":"55","type":"integer","maximum":"2047","description":"The maximum size, in megabytes (MB), of a POST request.","example":"55","nullable":"true"},"empty_trash_days":{"type":"string","example":"disabled","description":"The minimum age of files that the system will automatically purge from `.trash` folders in user home directories.","nullable":"true"},"disable_mailman":{"nullable":"true","enum":["1","0"],"example":"0","description":"Whether Mailman mailing lists are enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","type":"integer"},"disable_analog":{"type":"integer","enum":["1","0"],"example":"0","description":"Whether users can access the [*Analog Stats*](https://go.cpanel.net/cpaneldocsAnalogStats) interface (*cPanel >> Home >> Metrics >> Analog Stats*).\n\n* `1` - Enabled.\n* `0` - Not enabled.","nullable":"true"},"htaccess_check_recurse":{"example":"2","description":"The maximum number of directories deep to look for `.htaccess` files when you change the PHP handler.","nullable":"true","minimum":"0","type":"integer"},"mailbox_storage_format":{"enum":["mdbox","maildir"],"example":"maildir","description":"The mailbox storage format for new accounts.\n\n* `mdbox` - The mdbox storage format.\n* `maildir` - The maildir storage format.","nullable":"true","type":"string"},"php_maximum_execution_time":{"minimum":"90","type":"integer","description":"The number of seconds that a PHP script can run before the system terminates it.","example":"90","nullable":"true"},"disable_spamassassin":{"nullable":"true","description":"Whether the Apache SpamAssassin spam filter is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","example":"0","enum":["1","0"],"type":"integer"},"php_loader":{"nullable":"true","enum":["","ioncube","sourceguardian","ioncube,sourceguardian"],"example":"ioncube","description":"The PHP loaders through which the system executes internal PHP scripts.\n\n* `ioncube` - The ionCube PHP loader.\n* `sourceguardian` - The SourceGuardian PHP loader.\n* `ioncube,sourceguardian` - Both the ionCube and SourceGuardian PHP loaders are in use.\n* An emtpy string - PHP loader is not in use.","type":"string"},"disable_roundcube":{"type":"integer","description":"Whether [Roundcube webmail](https://roundcube.net/) is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.","enum":["1","0"],"example":"0","nullable":"true"},"apache_ssl_port":{"type":"string","example":"192.0.2.0:443","description":"The IP address or IP address with a firewall port number that Apache uses to listen for requests and serve web pages over a secure connection.","nullable":"true"},"ssl_default_key_type":{"description":"The default SSL/TLS encryption algorithm used by the system.\n\n* `rsa-2048` - The rsa-2048 encryption algorithm.\n* `ecdsa-secp384r1` - The ecdsa-secp384r1 encryption algorithm.\n* `ecdsa-prime256v1` - The ecdsa-prime256v1 encryption algorithm.\n* `rsa-4096` - The rsa-4096 encryption algorithm.","enum":["rsa-2048","ecdsa-secp384r1","ecdsa-prime256v1","rsa-4096"],"example":"rsa-2048","nullable":"true","type":"string"},"database_prefix_required":{"type":"integer","enum":["1","0"],"example":"1","description":"Whether the account requires database prefixing.\n\n* `1` - Requires database prefixing.\n* `0` - Doesn't require database prefixing.","nullable":"true"}}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"get_server_information","description":"The name of the method called.","type":"string"}}}}}}},"description":"This function retrieves the configuration settings for the cPanel & WHM server on which an account exists. This is useful, for example, to verify which applications and functionality are available on the account.","operationId":"Variables-get_server_information","parameters":[{"examples":{"multiple":{"value":"name=allow_park_subdomain_on_hostname&name=allow_remote_domains&name=allow_reset_password","summary":"Get multiple configuration settings."},"single":{"summary":"Get a single configuration setting.","value":"allow_park_subdomain_on_hostname"}},"description":"The server configuration settings to return.\n\n<details>\n<summary>Click to view information about the available server configuration settings.</summary>\n\n* `default_theme` - The cPanel interface's default theme.\n* `email_filter_storage_directory` - The location of the Exim email filter storage directory.\n* `allow_park_subdomain_on_hostname` - Whether the system allows users to park subdomains of the server's hostname.\n* `allow_remote_domains` - Whether the system allows users to create addon domains or aliases that resolve to other servers.\n* `allow_unregistered_domains` - Whether the system allows users to add domains they didn't register with a domain name registrar.\n* `apache_port` - The IP address or IP address with a firewall port number that Apache® uses to listen for requests and serve web pages over an unsecured connection.\n* `apache_ssl_port` - The port or IP address that Apache uses to listen for requests and serve web pages over a secure connection.\n* `api_shell` - Whether the user can access cPanel's [*API Shell*](https://go.cpanel.net/cpaneldocsAPIShell) interface (*cPanel >> Home >> Advanced >> API Shell*).\n* `awstats_browser_update` - Whether the user can update their [AWStats](http://awstats.sourceforge.net/) software.\n* `awstats_reverse_dns` - Whether the AWStats statistical analysis software interprets visitors' domain names as IP addresses.\n* `cpanel_root_directory` - The cPanel `root` directory.\n* `database_prefix_required` - Whether the account requires database prefixing.\n* `display_cpanel_doclinks` - Whether the system displays links to cPanel feature documentation in the cPanel interface.\n* `dnsadmin_app` - The application that processes DNS management requests.\n* `empty_trash_days` - The minimum age of files that the system will automatically purge from `.trash` folders in user home directories.\n* `enable_file_protect` - Whether [EasyApache 4's *FileProtect* option](https://go.cpanel.net/EasyApache4FileprotectOption) is enabled.\n* `file_upload_maximum_bytes` - The maximum file size, in megabytes (MB), that a user can upload to a server.\n* `file_upload_must_leave_bytes` - The minimum filesystem quota that the system requires after a file uploads to a server.\n* `file_usage` - Whether file usage information displays in the cPanel *Home* interface's statistics bar.\n* `ftp_server` - The FTP server.\n* `htaccess_check_recurse` - The maximum number of directories deep to look for `.htaccess` files when you change the PHP handler.\n* `invite_sub` - Whether cPanel account users can send invitations to new Subaccount users via cPanel's [*User Manager*](https://go.cpanel.net/cpaneldocsUserManager) interface (*cPanel >> Home >> Preferences >> User Manager*).\n* `ipv6_listen` - Whether the `cpsrvd` daemon and other cPanel & WHM services listen on IPv6.\n* `local_nameserver_type` - The DNS nameserver's type.\n* `logout_redirect_url` - The logout redirection URL.\n* `mailbox_storage_format` - The mailbox storage format for new accounts.\n* `mail_server` - The mailserver type.\n* `minimum_password_strength` - The minimum strength for cPanel account passwords. \n* `minimum_password_strength_mysql` - The minimum strength for MySQL® or MariaDB® passwords.\n* `mysql_host` - The MySQL or MariaDB hostname or IP address.\n* `mysql_version` - The MySQL or MariaDB version.\n* `php_maximum_execution_time` - The number of seconds that a PHP script can run before the system terminates it.\n* `php_post_maximum_size` - The maximum size, in megabytes (MB), of a POST request.\n* `php_system_default_version` - The system's default version of PHP.\n* `php_upload_maximum_filesize` - The maximum file size, in megabytes (MB), that a PHP script may upload.\n* `php_loader` - The PHP loaders through which the system executes internal PHP scripts.\n* `php_open_basedir_home` - Whether PHP `open_basedir` protection is enabled on the server.\n* `phpmyadmin_disable_search_info_schema` - Whether the user can search for the phpMyAdmin information schema.\n* `docroots_in_public_html_only` - Whether the system restricts users from creating addon domains and subdomains outside of their `public_html` directory.\n* `require_ssl` - Whether the system requires passwords and other sensitive information use SSL encryption.\n* `allow_reset_password` - Whether cPanel's [*Reset Password*](https://go.cpanel.net/resetsubaccountpass) feature is enabled for the account.\n* `allow_reset_password_for_subaccounts` - Whether cPanel's [*Reset Password*](https://go.cpanel.net/resetsubaccountpass) feature is enabled for subaccounts on the account.\n* `disable_analog` - Whether users can access the [*Analog Stats*](https://go.cpanel.net/cpaneldocsAnalogStats) interface (*cPanel >> Home >> Metrics >> Analog Stats*).\n* `skip_apache_clients_optimizer` - Whether the Apache Client Optimizer is enabled.\n* `disable_awstats` - Whether the [AWStats](http://awstats.sourceforge.net/) software is enabled.\n* `skip_mailbox_warnings_check` - Whether mailbox usage warnings are enabled.\n* `disable_boxtrapper` - Whether [*BoxTrapper*](https://go.cpanel.net/cpaneldocsBoxTrapper) is enabled.\n* `skip_bandwidth_limit_check` - Whether the system automatically suspends HTTP service for accounts that exceed their bandwidth limit.\n* `disable_mailman` - Whether Mailman mailing lists are enabled.\n* `disable_roundcube` - Whether [Roundcube webmail](https://roundcube.net/) is enabled.\n* `disable_spamassassin` - Whether the Apache SpamAssassin™ spam filter is enabled.\n* `disable_spambox` - Whether Apache SpamAssassin's spam box feature is enabled.\n* `disable_webalizer` - Whether the [Webalizer](https://docs.cpanel.net/cpanel/metrics/webalizer/) statistics program is enabled.\n* `ssl_default_key_type` - The default SSL/TLS encryption algorithm used by the system.\n* `use_information_schema` - Whether the system uses the MySQL® `INFORMATION_SCHEMA` view. This view includes disk usage by all MySQL tables in the disk usage totals.\n* `use_mail_for_mailman_url` - Whether the system prefixes Mailman URLs with the `mail` prefix. For example, `http://mail.domain.com/mailman`.\n* `is_mod_userdir_enabled` - Whether the [Apache `mod_userdir` Tweak](https://go.cpanel.net/whmdocsApachemod_userdirTweak) is enabled.\n* `version` - The system's Linux® kernel version.\n</details>\n\n**Note:**\n\n* If you don't use this parameter, this function returns **all** of the server's configuration settings.\n* To retrieve multiple variables, increment this parameter. For example, `name-1=variable`, `name-2=variable`, `name-3=variable`.","schema":{"enum":["default_theme","email_filter_storage_directory","allow_park_subdomain_on_hostname","allow_remote_domains","allow_unregistered_domains","apache_port","apache_ssl_port","api_shell","awstats_browser_update","awstats_reverse_dns","cpanel_root_directory","database_prefix_required","display_cpanel_doclinks","dnsadmin_app","empty_trash_days","enable_file_protect","file_upload_maximum_bytes","file_upload_must_leave_bytes","file_usage","ftp_server","htaccess_check_recurse","invite_sub","ipv6_listen","local_nameserver_type","logout_redirect_url","mailbox_storage_format","mail_server","minimum_password_strength","minimum_password_strength_mysql","mysql_host","mysql_version","php_maximum_execution_time","php_post_maximum_size","php_system_default_version","php_upload_maximum_filesize","php_loader","php_open_basedir_home","phpmyadmin_disable_search_info_schema","docroots_in_public_html_only","require_ssl","allow_reset_password","allow_reset_password_for_subaccounts","disable_analog","skip_apache_clients_optimizer","disable_awstats","skip_mailbox_warnings_check","disable_boxtrapper","skip_bandwidth_limit_check","disable_mailman","disable_roundcube","disable_spamassassin","disable_spambox","disable_webalizer","ssl_default_key_type","use_information_schema","use_mail_for_mailman_url","is_mod_userdir_enabled","version"],"type":"string"},"in":"query","name":"name","required":"false"}],"x-cpanel-api-version":"UAPI","summary":"Return server's configuration settings","tags":["cPanel Server Information","Variables"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Variables \\\n  get_server_information\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Variables/get_server_information"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Variables_get_server_information.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Variables_get_server_information.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/Variables/,\n    q/get_server_information/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Variables_get_server_information.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Variables_get_server_information.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    'Variables',\n    'get_server_information'\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}}},"WordPressRestore":{"start":{"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Backups"]}],"paths":{"/WordPressRestore/start":{"get":{"operationId":"WordPressRestore-start","description":"This function starts a single WordPress® site backup restoration.\n\n**Note:**\n\nYou **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","parameters":[{"name":"site","in":"query","required":"true","examples":{"single-path":{"summary":"Domain with path.","value":"example.com/wordpress"},"single-domain":{"summary":"Just a domain.","value":"example.com"}},"description":"The WordPress site's URL to restore.","schema":{"type":"string"}},{"description":"The file path to the backup archive.","schema":{"format":"path","example":"/home/example/wordpress-backups/example.com__2018-11-13T11:11:31-0600.tar.gz","type":"string"},"in":"query","name":"backup_path","required":"true"}],"x-cpanel-available-version":"WordPress Manager 3.0","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"WordPressRestore","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"type":"object","properties":{"restore_id":{"type":"string","description":"The unique identifier for the restoration operation. The name of the backup file without the file extension.","example":"example.com__2018-11-15T08:03:22-0600"}}},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"description":"The name of the method called.","example":"start","type":"string"}}}}}}},"tags":["WordPressRestore","WordPress Manager Backups"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressRestore \\\n  start \\\n  site='example.com' \\\n  backup_path='/home/example/wordpress-backups/example.com__2018-11-13T11:11:31-0600.tar.gz'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressRestore/start?site=example.com&backup_path=%2fhome%2fexample%2fwordpress-backups%2fexample.com__2018-11-13T11%3a11%3a31-0600.tar.gz","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressRestore_start.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressRestore_start.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/WordPressRestore/,\n    q/start/,\n    {\n        'site' => 'example.com',\n        'backup_path' => '/home/example/wordpress-backups/example.com__2018-11-13T11:11:31-0600.tar.gz',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressRestore_start.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressRestore_start.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    'WordPressRestore',\n    'start',\n    array (\n        'site' => 'example.com',\n        'backup_path' => '/home/example/wordpress-backups/example.com__2018-11-13T11:11:31-0600.tar.gz',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Restore WordPress site"}}},"tags":[{"name":"WordPressRestore","description":"The WordPressRestore module for UAPI."},{"name":"WordPress Manager Backups","description":"Optional Applications / WordPress Manager Backups"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"cleanup":{"tags":[{"name":"WordPressRestore","description":"The WordPressRestore module for UAPI."},{"name":"WordPress Manager Backups","description":"Optional Applications / WordPress Manager Backups"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["WordPress Manager Backups"],"name":"Optional Applications"}],"paths":{"/WordPressRestore/cleanup":{"get":{"parameters":[{"schema":{"type":"string"},"description":"The WordPress site's URL **without** the protocol prefix.","examples":{"single-path":{"value":"example.com/wordpress","summary":"Domain with path."},"single-domain":{"summary":"Just a domain.","value":"example.com"}},"required":"true","in":"query","name":"site"}],"description":"This function cleans up any temporary system resources after a WordPress® site backup restoration.\n\n**Note:**\n\nYou **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"WordPressRestore-cleanup","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"data":{"type":"integer","description":"Whether the system cleaned up the temporary system resources.\n* `1` - Successful.\n* `0` - Unsuccessful.","enum":["0","1"],"example":"1"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"WordPressRestore","type":"string"},"func":{"example":"cleanup","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"WordPress Manager 3.0","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressRestore \\\n  cleanup \\\n  site='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressRestore/cleanup?site=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressRestore_cleanup.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressRestore_cleanup.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/WordPressRestore/,\n    q/cleanup/,\n    {\n        'site' => '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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressRestore_cleanup.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressRestore_cleanup.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    'WordPressRestore',\n    'cleanup',\n    array (\n        'site' => '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}"}],"tags":["WordPressRestore","WordPress Manager Backups"],"summary":"Delete restored WordPress site's temporary files","x-cpanel-api-version":"UAPI"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"any_running":{"x-tagGroups":[{"tags":["WordPress Manager Backups"],"name":"Optional Applications"}],"paths":{"/WordPressRestore/any_running":{"get":{"x-cpanel-available-version":"WordPress Manager 3.0","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"properties":{"items":{"oneOf":[{"$ref":"#/components/schemas/RestoreInProgress"},{"$ref":"#/components/schemas/RestoreNotInProgress"}]}}},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"WordPressRestore","description":"The name of the module called."},"func":{"description":"The name of the method called.","example":"any_running","type":"string"}}},"examples":{"NotInProgress":{"summary":"Example output of a backup restore not in progress.","value":{"data":{"sites":[],"last_outcome":{"error":"","site":"example.com","status":"success","have_outcome":"1"},"any_running":"0"},"status":"1","errors":null,"metadata":{},"messages":null,"warnings":null}},"InProgress":{"summary":"Example output of a backup restore in progress.","value":{"messages":null,"warnings":null,"data":{"sites":[{"site":"example.com","type":"restore","id":null}],"any_running":"1"},"errors":null,"status":"1","metadata":{}}}}}}}},"description":"This function returns whether a WordPress® site backup restoration is in progress.\n\n**Note:**\n\n* You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.\n* The output of this function changes, depending on the state of the backup restoration.","operationId":"WordPressRestore::any_running","parameters":[],"summary":"Return WordPress site restore status","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressRestore \\\n  any_running\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressRestore/any_running","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressRestore_any_running.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressRestore_any_running.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/WordPressRestore/,\n    q/any_running/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressRestore_any_running.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressRestore_any_running.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    'WordPressRestore',\n    'any_running'\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}"}],"tags":["WordPressRestore","WordPress Manager Backups"]}}},"tags":[{"name":"WordPressRestore","description":"The WordPressRestore module for UAPI."},{"description":"Optional Applications / WordPress Manager Backups","name":"WordPress Manager Backups"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"openapi":"3.0.2","components":{"schemas":{"RestoreNotInProgress":{"properties":{"any_running":{"description":"Whether the system is processing a backup restoration.\n\n* `0` - No restoration in progress. This is the only possible value.","enum":["0"],"type":"integer"},"last_outcome":{"properties":{"site":{"description":"The WordPress site's URL without the protocol prefix.","format":"domain","type":"string"},"status":{"type":"string","enum":["success","error","terminated","timeout","low-disk","low-quota"],"description":"The previous restoration attempt's result.\n\n* `success` - Successful restoration.\n* `error` - The attempted restoration resulted in an error.\n* `terminated` - The system stopped the restoration process.\n* `timeout` - The restoration process exceeded the allowed time limit.\n* `low-disk` - The server's disk space was insufficient to complete the restoration.\n* `low-quota` - The cPanel account's quota was insufficient to complete the restoration."},"have_outcome":{"type":"integer","enum":["0","1"],"description":"Whether the restoration log shows a successful attempt previously occurred,\nsuccessfully or unsuccessfully.\n\n* `1` - Restoration attempt occurred.\n* `0` - No restoration attempt occurred."},"error":{"type":"string","description":"Where the system encountered an error during the last backup restoration.\n\n* The error message from the restoration log database.\n* `null` - No occur occurred.","nullable":"true"}},"description":"The status of the last backup restoration."},"sites":{"description":"Information about the site that the system is actively restoring.\n\n**Note:**\n\n* This function returns an empty array when there is **not** an active\nbackup restoration. This is the only possible value.\n* We have not implemented this return.","type":"object"}}},"RestoreInProgress":{"properties":{"any_running":{"description":"Whether the system is processing a backup restoration.\n\n* `1` - Restoration in progress. This is the only possible value.","enum":["1"],"type":"integer"},"sites":{"items":{"type":"object","properties":{"type":{"type":"string","description":"The active process type.\n\n* `restore` is the only possible value.","enum":["restore"]},"id":{"type":"string","description":"The restore process's unique ID.\n\n* `null` is the only possible value.\n* We have not implemented this return.","enum":[null],"nullable":"true"},"site":{"type":"string","description":"The WordPress site's URL without the protocol prefix.","format":"domain"}}},"description":"Information about the site that the system is actively restoring.\n\n**Note:**\n\nWe have not implemented this return.","type":"array"}}}},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}},"Contactus":{"is_enabled":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"tags":[{"name":"Contactus","description":"The Contactus module for UAPI."},{"name":"Contact Information","description":"cPanel Account / Contact Information"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"cPanel Account","tags":["Contact Information"]}],"paths":{"/Contactus/is_enabled":{"get":{"tags":["Contactus","Contact Information"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Contactus \\\n  is_enabled\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Contactus/is_enabled","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Contactus_is_enabled.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Contactus_is_enabled.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/Contactus/,\n    q/is_enabled/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Contactus_is_enabled.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Contactus_is_enabled.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    'Contactus',\n    'is_enabled'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return whether contact option is enabled","parameters":[],"description":"This function checks whether the cPanel account can contact their hosting provider from the cPanel interface.","operationId":"is_enabled","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"type":"object","properties":{"enabled":{"description":"Whether the cPanel account can contact their hosting provider\nfrom the cPanel interface.\n\n* `1` — The cPanel account can contact their hosting provider\nfrom the cPanel interface.\n* `0` — The cPanel account **cannot** contact their hosting\nprovider from the cPanel interface.","example":"1","enum":["0","1"],"type":"integer"}}},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"Contactus","description":"The name of the module called."},"func":{"example":"is_enabled","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}}}},"Backup":{"fullbackup_to_scp_with_key":{"paths":{"/Backup/fullbackup_to_scp_with_key":{"get":{"parameters":[{"description":"The remote server's hostname or IP address.","schema":{"example":"example.com","type":"string","oneOf":[{"format":"hostname","description":"A valid hostname.","type":"string"},{"type":"string","description":"A valid IP address.","format":"ipv4"}]},"name":"host","in":"query","required":"true"},{"schema":{"example":"22","default":"22","minimum":"1","maximum":"65335","type":"integer"},"description":"The port to use during the transfer.","required":"false","in":"query","name":"port"},{"in":"query","name":"homedir","required":"false","description":"How to manage the home directory in the backup.\n\n* `include` — Include the home directory in the backup.\n* `skip` — Omit the home directory from the backup.","schema":{"default":"include","enum":["include","skip"],"example":"include","type":"string"}},{"required":"true","name":"key_name","in":"query","schema":{"type":"string","example":"examplesshkey"},"description":"The SSH key's name.\n\n**Notes:**\n\n* To generate a private SSH key, use the UAPI `SSL::generate_key`\nfunction.\n* To import an existing SSH key, use the cPanel API 2\n`SSH::importkey` function."},{"description":"The SSH key's password.","schema":{"example":"123456luggage","type":"string","minLength":"4"},"in":"query","name":"key_passphrase","required":"true"},{"in":"query","name":"directory","required":"false","description":"The directory on the remote server that will store the backup.\n\n**Note:**\n\nThis parameter defaults to the remote server account's default login directory.","schema":{"example":"/user","type":"string"}},{"description":"The email address to receive a confirmation email when the backup completes.\n\n**Note:**\n\nThe system does **not** provide confirmation if you do not pass this parameter.","schema":{"example":"username@example.com","format":"email","default":null,"type":"string"},"in":"query","name":"email","required":"false"}],"operationId":"fullbackup_to_scp_with_key","description":"This function creates a full backup to a remote server with a private SSH key via the secure copy protocol (scp) command. The system creates a file in the `backup-MM.DD.YYYY_HH-mm-ss_username.tar.gz` filename format.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Backup"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"object","properties":{"pid":{"type":"string","description":"The backup's process identifier.","example":"2857"}}},"metadata":{"properties":{}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}}},"func":{"example":"fullbackup_to_scp_with_key","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 78","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  fullbackup_to_scp_with_key \\\n  host='example.com' \\\n  key_name='examplesshkey' \\\n  key_passphrase='123456luggage'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Backup/fullbackup_to_scp_with_key?host=example.com&key_name=examplesshkey&key_passphrase=123456luggage","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Backup_fullbackup_to_scp_with_key.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Backup_fullbackup_to_scp_with_key.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/Backup/,\n    q/fullbackup_to_scp_with_key/,\n    {\n        'host' => 'example.com',\n        'key_name' => 'examplesshkey',\n        'key_passphrase' => '123456luggage',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Backup_fullbackup_to_scp_with_key.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Backup_fullbackup_to_scp_with_key.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    'Backup',\n    'fullbackup_to_scp_with_key',\n    array (\n        'host' => 'example.com',\n        'key_name' => 'examplesshkey',\n        'key_passphrase' => '123456luggage',\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}"}],"tags":["Backup"],"summary":"Back up cPanel account via SCP with SSH key","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"cPanel Account Backups","tags":["Backup"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The Backup module for UAPI.","name":"Backup"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"restore_email_forwarders":{"paths":{"/Backup/restore_email_forwarders":{"post":{"parameters":[{"in":"query","name":"backup","required":"false","description":"The email forwarder file to restore.\n\n**Important:**\n\n**Only** pass this parameter to restore email forwarder files that already exist on the server.\n\n**Note:**\n\nTo restore multiple email filter files, increment the parameter name. For example: `backup-1`, `backup-2`, and `backup-3`.","examples":{"multiple":{"value":"backup-1=/home/user/aliases-example1.com.gz backup-2=/home/user/aliases-example2.com.gz backup-3=/home/user/aliases-example3.com.gz","summary":"Restore multiple email forwarder files."},"single":{"value":"/home/user/aliases-example.com.gz","summary":"Restore a single email forwarder file."}},"schema":{"type":"string"}},{"in":"query","name":"verbose","required":"false","description":"Whether to return additional information from the `/home/cpuser/.cpanel/logs/restore-email-forwarders` log files.\n* `1` - Return additional information.\n* `0` - Do not return additional information.","schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"}},{"schema":{"minimum":"0","type":"integer","example":"3600","default":"7200"},"description":"The maximum number of seconds to try to restore the file.\n* `0` - The system will not time out the file restoration.","required":"false","in":"query","name":"timeout"}],"description":"This function restores an account's email forwarders.\n\n**Important:**\n\nWhen the [Receive Mail role](https://go.cpanel.net/howtouseserverprofiles#roles) is disabled, the system also **disables** this function.\n\n**Note:**\n\nYou **must** use the `backup` parameter when you call this function in one of the following formats:\n* As part of a `multipart/form-data` request body to upload and restore a backup file to the server. For more information about this structure, read Mozilla's [POST Method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) documentation.\n* As a query parameter to restore an existing file on the server.","operationId":"restore_email_forwarders","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"restore_email_forwarders","description":"The name of the method called.","type":"string"},"module":{"example":"Backup","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"type":"object","properties":{"log_id":{"type":"string","description":"The log file's restoration identification (ID). The system uses the backup restoration's date to create this ID. The ID is in [ISO-8601 Date Time](https://en.wikipedia.org/wiki/ISO_8601) format with the log's revision number appended.","example":"2019-08-13T15:10:07Z.1"},"messages":{"description":"An array of statements about the database's restoration.","items":{"example":"The system successfully restored the email forwarders from the 'aliases-example.com.gz' backup.","type":"string"},"type":"array"},"log_path":{"example":"/home/cpuser/.cpanel/logs/restore-email-forwarders/2019-09-11T18:30:49Z.1.log","format":"path","description":"The filepath to the backup restoration's log file.","type":"string"}}},"metadata":{"properties":{}},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 86","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --input=json --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  restore_email_forwarders\n"},{"label":"HTTP Request (Wire Format)","lang":"HTTP","source":"POST /cpsess##########/execute/Backup/restore_email_forwarders HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 0\n\n"}],"tags":["File Restoration"],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"backup":{"format":"binary","type":"string"}}}}},"description":"The email forwarder file to upload and restore.\n\n**Important:**\n\n* **Only** pass this parameter to upload files that don't already exist on the server.\n* You can't pass this parameter on the command line.\n\n**Note:**\n\nTo upload multiple email filter files, increment the parameter name. For example: `backup-1`, `backup-2`, and `backup-3`."},"summary":"Restore email forwarders","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["File Restoration"],"name":"cPanel Account Backups"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"name":"File Restoration","description":"cPanel Account Backups / File Restoration"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"restore_databases":{"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"cPanel Account Backups / File Restoration","name":"File Restoration"}],"paths":{"/Backup/restore_databases":{"post":{"summary":"Restore databases","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --input=json --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  restore_databases\n","label":"CLI","lang":"Shell"},{"source":"POST /cpsess##########/execute/Backup/restore_databases HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 0\n\n","label":"HTTP Request (Wire Format)","lang":"HTTP"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}},"description":"The database backup file to upload and restore.\n\n**Important:**\n\n* **Only** pass this parameter to upload files that don't already exist on the server.\n* You can **not** pass this parameter on the command line.\n\n**Note:**\n\n* To upload multiple database backup files, increment the parameter name. For example: `file-1`, `file-2`, and `file-3`.\n* Pass this file in a multipart/form-data structure.\n* For more information about this structure, read Mozilla's [POST Method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) documentation."},"tags":["File Restoration"],"x-cpanel-available-version":"cPanel 84","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"restore_databases"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"properties":{"log_id":{"description":"The log file's restoration identification (ID). The system uses the backup restoration's date to create this ID. The ID is in [ISO-8601 Date Time](https://en.wikipedia.org/wiki/ISO_8601) format with the log's revision number appended.","example":"2019-08-13T15:10:07Z.1","type":"string"},"messages":{"type":"array","description":"An array of statements about the database's restoration.","items":{"example":"The system successfully restored the database 'user_db1' from the backup file 'user_db1.sql.gz'","type":"string"}},"log_path":{"example":"/home/cptest/logs/restoredb/2019-08-13T15:10:07Z.1.log","format":"path","description":"The filepath to the backup restoration's log file.","type":"string"}},"type":"object"},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Backup","description":"The name of the module called."}}}}}}},"description":"This function restores a database's backup files.\n\n**Important:**\n\nWhen the [MySQL Client role](https://go.cpanel.net/howtouseserverprofiles#roles) is disabled, the system also **disables** this function.\n\n**Note:**\n\nYou **must** pass either the `file` **or** `backup` parameter.","operationId":"restore_databases","parameters":[{"schema":{"type":"string"},"examples":{"single":{"summary":"Restore a single database backup file.","value":"home/user/user_db1.sql.gz"},"multiple":{"value":"backup-1=home/user/user_db1.sql.gz backup-2=home/user/user_db2.sql.gz backup-3=home/user/user_db3.sql.gz","summary":"Restore multiple database backup files."}},"description":"The database backup file to restore.\n\n**Important:**\n\n**Only** pass this parameter to restore files already on the server.\n\n**Note:**\n\nTo restore multiple database backup files, increment the parameter name. For example: `backup-1`, `backup-2`, and `backup-3`.","required":"false","name":"backup","in":"query"},{"schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"},"description":"Whether to return additional information from the `/usr/local/cpanel/logs/cpbackup` log file.\n* `1` - Return additional information.\n* `0` - Do **not** return additional information.","required":"false","in":"query","name":"verbose"},{"in":"query","name":"timeout","required":"false","description":"The maximum number of seconds to try to restore the file.\n* `0` - The system will not time out the file restoration.","schema":{"example":"3600","default":"7200","type":"integer","minimum":"0"}}]}}},"x-tagGroups":[{"tags":["File Restoration"],"name":"cPanel Account Backups"}]},"fullbackup_to_ftp":{"tags":[{"description":"The Backup module for UAPI.","name":"Backup"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Backup"],"name":"cPanel Account Backups"}],"paths":{"/Backup/fullbackup_to_ftp":{"get":{"operationId":"fullbackup_to_ftp","description":"This function creates a full backup to the remote server via File Transfer Protocol (FTP). The system creates a file in the `backup-MM.DD.YYYY_HH-mm-ss.tar.gz` filename format.","parameters":[{"description":"Whether to use the `active` or `passive` FTP variant to connect to\nthe remote server. For more information about FTP variants, read our How\nto [Enable FTP Passive Mode](https://go.cpanel.net/HowtoEnableFTPPassiveMode) documentation.\n* `active` — The FTP server responds to the connection attempt and returns a connection request from a different port to the FTP client.\n* `passive` — The FTP client initiates connection attempts.","schema":{"type":"string","default":"active","enum":["active","passive"],"example":"active"},"in":"query","name":"variant","required":"false"},{"in":"query","name":"username","required":"true","description":"The remote server account's username.","schema":{"type":"string","example":"username"}},{"description":"The remote server account's password.","schema":{"type":"string","example":"luggage123456"},"in":"query","name":"password","required":"true"},{"description":"The remote server's hostname or IP address.","schema":{"type":"string","oneOf":[{"type":"string","format":"hostname","description":"A valid hostname."},{"type":"string","format":"ipv4","description":"A valid IP address."}],"example":"example.com"},"name":"host","in":"query","required":"true"},{"in":"query","name":"directory","required":"false","description":"The directory on the remote server that will store the backup.\n\n**Note:**\n\n* This value defaults to the remote server account's default login directory.\n* Enter the directory relative to the FTP user's login directory. For example, enter `/public_ftp` not `/home/username/public_ftp`.","schema":{"example":"/public_ftp","type":"string"}},{"schema":{"maximum":"65535","type":"integer","minimum":"1","example":"21","default":"21"},"description":"The port number to use during the transfer.","required":"false","in":"query","name":"port"},{"name":"homedir","in":"query","required":"false","description":"How to manage the home directory in the backup.\n\n* `include` — Include the home directory in the backup.\n* `skip` — Omit the home directory from the backup.","schema":{"enum":["include","skip"],"example":"include","default":"include","type":"string"}},{"schema":{"example":"username@example.com","format":"email","default":null,"type":"string"},"description":"The email address to receive a confirmation email when the backup completes.\n\n**Note:**\n\n The system does **not** provide confirmation if you do **not** pass this parameter.","required":"false","in":"query","name":"email"}],"x-cpanel-available-version":"cPanel 78","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Backup","description":"The name of the module called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"properties":{"pid":{"example":"2857","description":"The backup's process identifier.","type":"string"}},"type":"object"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"enum":["0","1"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"func":{"description":"The name of the method called.","example":"fullbackup_to_ftp","type":"string"}},"type":"object"}}}}},"tags":["Backup"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  fullbackup_to_ftp \\\n  username='username' \\\n  password='luggage123456' \\\n  host='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Backup/fullbackup_to_ftp?username=username&password=luggage123456&host=example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Backup_fullbackup_to_ftp.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Backup_fullbackup_to_ftp.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/Backup/,\n    q/fullbackup_to_ftp/,\n    {\n        'username' => 'username',\n        'password' => 'luggage123456',\n        'host' => '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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Backup_fullbackup_to_ftp.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Backup_fullbackup_to_ftp.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    'Backup',\n    'fullbackup_to_ftp',\n    array (\n        'username' => 'username',\n        'password' => 'luggage123456',\n        'host' => '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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Back up cPanel account via FTP"}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}}},"list_backups":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"openapi":"3.0.2","x-tagGroups":[{"name":"cPanel Account Backups","tags":["Backup"]}],"paths":{"/Backup/list_backups":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return backup files","tags":["Backup"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  list_backups\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Backup/list_backups","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Backup_list_backups.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Backup_list_backups.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/Backup/,\n    q/list_backups/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Backup_list_backups.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Backup_list_backups.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    'Backup',\n    'list_backups'\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-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Backup","description":"The name of the module called."},"result":{"type":"object","properties":{"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"data":{"type":"array","description":"An array of the account's backup files.","items":{"example":"2014-12-02","format":"ISO-8601 Date","type":"string"}},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"},"cnt":{"type":"integer","description":"The number of backup files.","example":"1"}}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"list_backups","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function lists the account's backup files.","operationId":"list_backups","parameters":[]}}},"tags":[{"description":"The Backup module for UAPI.","name":"Backup"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}]},"restore_email_filters":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"description":"cPanel Account Backups / File Restoration","name":"File Restoration"}],"paths":{"/Backup/restore_email_filters":{"post":{"operationId":"restore_email_filters","description":"This function restores an account's email filters.\n\n**Important:**\n\nWhen the [Receive Mail role](https://go.cpanel.net/howtouseserverprofiles#roles) is disabled, the system also **disables** this function.\n\n**Note:**\n\nYou **must** use the `backup` parameter when you call this function in one of the following formats:\n* As part of a `multipart/form-data` request body to upload and restore a backup file to the server.\n* As a query parameter to restore an existing file on the server.","parameters":[{"in":"query","name":"backup","required":"false","examples":{"single":{"summary":"Restore a single email filter file.","value":"/home/user/filter_info.username.yaml.gz"},"multiple":{"summary":"Restore multiple email filter files.","value":"backup-1=/home/user/filter_info1.username.yaml.gz backup-2=/home/user/filter_info2.username.yaml.gz backup-3=/home/user/filter_info3.username.yaml.gz"}},"description":"The email filter file to restore.\n\n**Important:**\n\n**Only** pass this parameter to restore email filter files that already exist on the server.\n\n**Note:**\n\nTo restore multiple email filter files, increment the parameter name. For example: `backup-1`, `backup-2`, and `backup-3`.","schema":{"type":"string"}},{"in":"query","name":"verbose","required":"false","description":"Whether to return additional information from the `/home/cpuser/.cpanel/logs/restore-email-filters` log files.\n* `1` - Return additional information.\n* `0` - Do not return additional information.","schema":{"example":"1","enum":["0","1"],"default":"0","type":"integer"}},{"name":"timeout","in":"query","required":"false","description":"The maximum number of seconds to try to restore the file.\n* `0` - The system will not time out the file restoration.","schema":{"example":"3600","default":"7200","minimum":"0","type":"integer"}}],"x-cpanel-available-version":"cPanel 86","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"restore_email_filters","type":"string"},"result":{"type":"object","properties":{"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"data":{"properties":{"log_path":{"example":"/home/cpuser/.cpanel/logs/restore-email-filters/2019-09-11T18:30:49Z.1.log","format":"path","description":"The filepath to the backup restoration's log file.","type":"string"},"log_id":{"description":"The log file's restoration identification (ID). The system uses the backup restoration's date to create this ID. The ID is in [ISO-8601 Date Time](https://en.wikipedia.org/wiki/ISO_8601) format with the log's revision number appended.","example":"2019-08-13T15:10:07Z.1","type":"string"},"messages":{"type":"array","description":"An array of statements about the database's restoration.","items":{"example":"The system successfully restored the email filters from the 'filter-info.user.yaml.gz' backup.","type":"string"}}},"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"Backup","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["File Restoration"],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"backup":{"type":"string","format":"binary"}},"type":"object"}}},"description":"The email filter file to upload and restore.\n\n**Important:**\n\n* **Only** pass this parameter to upload files that don't already exist on the server.\n* You can't pass this parameter on the command line.\n\n**Note:**\n\n* To upload multiple email filter files, increment the parameter name. For example: `backup-1`, `backup-2`, and `backup-3`.\n* Pass this file in a multipart/form-data structure.\n* For more information about this structure, read Mozilla's [POST Method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) documentation."},"x-codeSamples":[{"source":"uapi --input=json --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  restore_email_filters\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"HTTP Request (Wire Format)","source":"POST /cpsess##########/execute/Backup/restore_email_filters HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 0\n\n"}],"x-cpanel-api-version":"UAPI","summary":"Restore email filters"}}},"x-tagGroups":[{"name":"cPanel Account Backups","tags":["File Restoration"]}]},"fullbackup_to_scp_with_password":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"tags":["Backup"],"name":"cPanel Account Backups"}],"paths":{"/Backup/fullbackup_to_scp_with_password":{"get":{"tags":["Backup"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  fullbackup_to_scp_with_password \\\n  host='example.com' \\\n  username='username' \\\n  password='luggage123456'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Backup/fullbackup_to_scp_with_password?host=example.com&username=username&password=luggage123456","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Backup_fullbackup_to_scp_with_password.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Backup_fullbackup_to_scp_with_password.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/Backup/,\n    q/fullbackup_to_scp_with_password/,\n    {\n        'host' => 'example.com',\n        'username' => 'username',\n        'password' => 'luggage123456',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Backup_fullbackup_to_scp_with_password.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Backup_fullbackup_to_scp_with_password.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    'Backup',\n    'fullbackup_to_scp_with_password',\n    array (\n        'host' => 'example.com',\n        'username' => 'username',\n        'password' => 'luggage123456',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Back up cPanel account via SCP with password","description":"This function creates a full backup to a remote server via the secure copy protocol (`scp`) command with a password. The system creates a file in the `backup-MM.DD.YYYY_HH-mm-ss.tar.gz` filename format.","operationId":"fullbackup_to_scp_with_password","parameters":[{"description":"The remote server's hostname or IP address.","schema":{"example":"example.com","type":"string","oneOf":[{"description":"A valid ipv4 address.","format":"ipv4","type":"string"},{"description":"A valid hostname.","format":"hostname","type":"string"}]},"in":"query","name":"host","required":"true"},{"description":"The port to use during the transfer.","schema":{"minimum":"1","maximum":"65335","type":"integer","example":"22","default":"22"},"name":"port","in":"query","required":"false"},{"schema":{"type":"string","enum":["include","skip"],"example":"include","default":"include"},"description":"How to manage the home directory in the backup.\n\n* `include` — Include the home directory in the backup.\n* `skip` — Omit the home directory from the backup.","required":"false","name":"homedir","in":"query"},{"required":"true","in":"query","name":"username","schema":{"type":"string","example":"username"},"description":"The remote server account's username."},{"description":"The remote server account's password.","schema":{"example":"luggage123456","type":"string"},"name":"password","in":"query","required":"true"},{"schema":{"example":"/user","type":"string"},"description":"The directory on the remote server that will store the backup.\n\n**Note:**\n\nThis parameter defaults to the remote server account's default login directory.","required":"false","name":"directory","in":"query"},{"description":"The email address to receive a confirmation email when the backup completes.\n\n**Note:**\n\nThe system does **not** provide confirmation if you do **not** pass this parameter.","schema":{"example":"username@example.com","format":"email","default":null,"type":"string"},"in":"query","name":"email","required":"false"}],"x-cpanel-available-version":"cPanel 78","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"Backup","description":"The name of the module called."},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"data":{"type":"object","properties":{"pid":{"description":"The backup's process identifier.","example":"2857","type":"string"}}}}},"func":{"type":"string","example":"fullbackup_to_scp_with_password","description":"The name of the method called."}}}}}}}}}},"tags":[{"description":"The Backup module for UAPI.","name":"Backup"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"restore_files":{"x-tagGroups":[{"name":"cPanel Account Backups","tags":["File Restoration"]}],"paths":{"/Backup/restore_files":{"post":{"tags":["File Restoration"],"requestBody":{"description":"The backup file to upload and restore.\n\n**Important:**\n\n* **Only** pass this parameter to upload files that don't already exist on the server.\n* You can't pass this parameter on the command line.\n\n**Note:**\n\nTo upload and restore multiple backup files, increment the parameter name. For example: `backup-1`, `backup-2`, and `backup-3`.","content":{"multipart/form-data":{"schema":{"properties":{"backup":{"format":"binary","type":"string"}},"type":"object"}}}},"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --input=json --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  restore_files\n"},{"label":"HTTP Request (Wire Format)","lang":"HTTP","source":"POST /cpsess##########/execute/Backup/restore_files HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 0\n\n"}],"x-cpanel-api-version":"UAPI","summary":"Restore files","parameters":[{"required":"false","in":"query","name":"backup","schema":{"type":"string"},"description":"The backup file to restore.\n\n**Important:**\n\n**Only** pass this parameter to restore backup files that already exist on the server.\n\n**Note:**\n\nTo restore multiple backup files, increment the parameter name. For example: `backup-1`, `backup-2`, and `backup-3`.","examples":{"single":{"summary":"Restore a single backup file.","value":"/home/cpuser/backup-cpuser.tld-9-10-2019_1.tar.gz"},"multiple":{"summary":"Restore multiple backup files.","value":"backup-1=/home/cpuser/backup-cpuser.tld-9-10-2019_1.tar.gz backup-2=/home/cpuser/backup-cpuser.tld-9-10-2019_2.tar.gz"}}},{"description":"Whether to return additional information from the `/home/cptest/.cpanel/logs/restorefiles` log files.\n* `1` - Return additional information.\n* `0` - Do not return additional information.","schema":{"type":"integer","default":"0","enum":["0","1"],"example":"1"},"name":"verbose","in":"query","required":"false"},{"schema":{"example":"/home/user/example","format":"path","type":"string"},"description":"The directory to which to restore the file. The default is the user's `home` directory.","required":"false","name":"directory","in":"query"},{"description":"The maximum number of seconds to try to restore the file.\n* `0` - The system will not time out the file restoration.","schema":{"type":"integer","minimum":"0","default":"172800","example":"7200"},"name":"timeout","in":"query","required":"false"}],"description":"This function restores an account's files.\n\n**Important:**\n\nWhen the [File Storage role](https://go.cpanel.net/howtouseserverprofiles#roles) is disabled, the system also **disables** this function.\n\n**Note:**\n\nYou **must** use the `backup` parameter when you call this function in one of the following formats:\n* As part of a `multipart/form-data` request body to upload and restore a backup file to the server. For more information about this structure, read Mozilla's [POST Method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) documentation.\n* As a query parameter to restore an existing file on the server.","operationId":"restore_files","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Backup","description":"The name of the module called."},"result":{"properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"type":"object","properties":{"log_path":{"type":"string","format":"path","description":"The filepath to the backup restoration's log file.","example":"/home/cptest/.cpanel/logs/restorefiles/2019-08-13T15:10:07Z.1.log"},"messages":{"type":"array","items":{"type":"string","example":"The system successfully restored the directory /home/cpuser/point2 from the backup file backup-cpuser.tld-9-10-2019_1.tar.gz"},"description":"An array of statements about the database's restoration."},"log_id":{"type":"string","description":"The log file's restoration identification (ID). The system uses the backup restoration's date to create this ID. The ID is in [ISO-8601 Date Time](https://en.wikipedia.org/wiki/ISO_8601) format with the log's revision number appended.","example":"2019-08-13T15:10:07Z.1"}}}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"restore_files"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 86"}}},"tags":[{"name":"File Restoration","description":"cPanel Account Backups / File Restoration"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"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/","version":"11.89.0.9999"},"openapi":"3.0.2"},"fullbackup_to_homedir":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Backup module for UAPI.","name":"Backup"}],"paths":{"/Backup/fullbackup_to_homedir":{"get":{"tags":["Backup"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Backup \\\n  fullbackup_to_homedir\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Backup/fullbackup_to_homedir"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Backup_fullbackup_to_homedir.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Backup_fullbackup_to_homedir.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/Backup/,\n    q/fullbackup_to_homedir/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Backup_fullbackup_to_homedir.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Backup_fullbackup_to_homedir.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    'Backup',\n    'fullbackup_to_homedir'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Back up cPanel account to home directory","operationId":"fullbackup_to_homedir","description":"This function creates a full backup to the user's home directory. The system creates a file in the `backup-MM.DD.YYYY_HH-mm-ss_username.tar.gz` filename format.","parameters":[{"in":"query","name":"email","required":"false","description":"The email address to receive a confirmation email when the backup process completes.\n\n**Note:**\n\nThe system does **not** provide confirmation if you do not pass this parameter.","schema":{"format":"email","default":null,"example":"username@example.com","type":"string"}},{"required":"false","in":"query","name":"homedir","schema":{"type":"string","default":"include","enum":["include","skip"],"example":"include"},"description":"How to manage the home directory in the backup.\n\n* `include` — Include the home directory in the backup.\n* `skip` — Omit the home directory from the backup."}],"x-cpanel-available-version":"cPanel 78","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"fullbackup_to_homedir","type":"string"},"result":{"type":"object","properties":{"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"metadata":{"properties":{}},"data":{"properties":{"pid":{"type":"string","example":"2857","description":"The backup's process identifier."}},"type":"object"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"description":"The name of the module called.","example":"Backup","type":"string"}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["Backup"],"name":"cPanel Account Backups"}]}},"Tokens":{"list":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"Tokens","description":"The Tokens module for UAPI."},{"description":"API Development Tools / API Token Management","name":"API Token Management"}],"paths":{"/Tokens/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Tokens"},"result":{"properties":{"data":{"items":{"properties":{"expires_at":{"nullable":"true","example":"1609372800","format":"unix_timestamp","description":"The API token's expiration time.\n\n* null — The API token does **not** expire.","type":"integer"},"create_time":{"type":"integer","description":"The API token's creation date and time.","format":"unix_timestamp","example":"1549471343"},"features":{"example":[],"description":"The account features that the API token has access to.\n\n* An empty array — The API token has full access.","items":{"type":"string"},"type":"array"},"name":{"type":"string","example":"exampletoken","description":"The API token's name."},"has_full_access":{"type":"integer","example":"1","enum":["1","0"],"description":"Whether the API token has full access to the account's features.\n\n* `1` — The API token has full access to the account's features.\n* `0` — The API token does **not** have full access to the\naccount's features."}},"type":"object"},"description":"An array of objects containing the account's API tokens.","type":"array"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"],"type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"list"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 80","parameters":[],"description":"This function returns a list of a cPanel account's API tokens.","operationId":"Tokens-list","x-cpanel-api-version":"UAPI","summary":"Return cPanel API tokens","tags":["Tokens","API Token Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Tokens \\\n  list\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Tokens/list"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Tokens_list.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Tokens_list.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/Tokens/,\n    q/list/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Tokens_list.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Tokens_list.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    'Tokens',\n    'list'\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-tagGroups":[{"tags":["API Token Management"],"name":"API Development Tools"}]},"rename":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Tokens","description":"The Tokens module for UAPI."},{"name":"API Token Management","description":"API Development Tools / API Token Management"}],"paths":{"/Tokens/rename":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update cPanel API token's name","tags":["Tokens","API Token Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Tokens \\\n  rename \\\n  name='example' \\\n  new_name='newexample'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Tokens/rename?name=example&new_name=newexample","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Tokens_rename.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Tokens_rename.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/Tokens/,\n    q/rename/,\n    {\n        'name' => 'example',\n        'new_name' => 'newexample',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Tokens_rename.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Tokens_rename.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    'Tokens',\n    'rename',\n    array (\n        'name' => 'example',\n        'new_name' => 'newexample',\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"rename","description":"The name of the method called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}}},"module":{"example":"Tokens","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 80","parameters":[{"required":"true","name":"name","in":"query","schema":{"type":"string","example":"example"},"description":"The API token's name."},{"description":"The new name for the API token.\n\n**Note:**\n\nThe name may only contain alphanumeric characters, dashes (`-`), and underscores (`_`).","schema":{"maxLength":"50","type":"string","example":"newexample"},"name":"new_name","in":"query","required":"true"}],"operationId":"rename","description":"This function renames a cPanel account's existing API token."}}},"x-tagGroups":[{"name":"API Development Tools","tags":["API Token Management"]}]},"create_full_access":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"paths":{"/Tokens/create_full_access":{"get":{"summary":"Create cPanel API token","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Tokens \\\n  create_full_access \\\n  name='example'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Tokens/create_full_access?name=example"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Tokens_create_full_access.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Tokens_create_full_access.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/Tokens/,\n    q/create_full_access/,\n    {\n        'name' => 'example',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Tokens_create_full_access.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Tokens_create_full_access.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    'Tokens',\n    'create_full_access',\n    array (\n        'name' => 'example',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Tokens","API Token Management"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"create_full_access","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"Tokens"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"properties":{"create_time":{"type":"integer","description":"The API token's creation date and time.","format":"unix_timestamp","example":"1549467298"},"token":{"type":"string","example":"JPQNSRU0DH448UJLGXH7KVJECC5QN9N9","description":"The generated API token."}},"type":"object"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 80","parameters":[{"in":"query","name":"name","required":"true","description":"The API token's name.\n\n**Note:**\n\nThe name may **only** contain alphanumeric characters, dashes (`-`), and underscores (`_`).","schema":{"example":"example","maxLength":"50","type":"string"}},{"name":"expires_at","in":"query","required":"false","description":"The API token's expiration time.\n\n**Important:**\n\n* When an API token expires the system does **not** delete it. You **must** manually delete expired API tokens.\n* If you do not use this parameter, the API token will **not** expire.","schema":{"type":"integer","format":"unix_timestamp","example":"1609372800"}}],"description":"This function creates a new API token with full access to all of a cPanel account's features.\n\n**Note:**\n\nThe token **only** grants access to the features that the account has access to. For example,\nif you disable the [*File Manager*](https://go.cpanel.net/cpaneldocsFileManager) feature, the\ntoken can't access it.","operationId":"create_full_access"}}},"x-tagGroups":[{"name":"API Development Tools","tags":["API Token Management"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"name":"Tokens","description":"The Tokens module for UAPI."},{"name":"API Token Management","description":"API Development Tools / API Token Management"}]},"revoke":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"Tokens","description":"The Tokens module for UAPI."},{"name":"API Token Management","description":"API Development Tools / API Token Management"}],"paths":{"/Tokens/revoke":{"get":{"summary":"Remove cPanel API token","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Tokens \\\n  revoke \\\n  name='example'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Tokens/revoke?name=example","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Tokens_revoke.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Tokens_revoke.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/Tokens/,\n    q/revoke/,\n    {\n        'name' => 'example',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Tokens_revoke.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Tokens_revoke.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    'Tokens',\n    'revoke',\n    array (\n        'name' => 'example',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Tokens","API Token Management"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"revoke","description":"The name of the method called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the system removed the API token.\n\n* `1` - The system removed the API token or the API token doesn't exist.\n* `0` - The system did **not** remove the API token.\n\n**Note:**\n\nThe system returns the data value in the function's metadata. This differs from our usual API return format. For more information, read our [UAPI Introduction](/cpanel/introduction/) documentation."},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."}},"type":"object"},"module":{"example":"Tokens","description":"The name of the module called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 80","parameters":[{"name":"name","in":"query","required":"true","description":"The API token to remove.","schema":{"type":"string","example":"example"}}],"description":"This function removes an API token from a cPanel account.","operationId":"revoke"}}},"x-tagGroups":[{"tags":["API Token Management"],"name":"API Development Tools"}]}},"DirectoryProtection":{"list_directories":{"x-tagGroups":[{"name":"Directory Management","tags":["Directory Protection"]}],"paths":{"/DirectoryProtection/list_directories":{"get":{"x-cpanel-available-version":"cPanel 88","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"list_directories","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"data":{"type":"object","properties":{"parent":{"description":"The parent directory of the current directory and its leech protection information.","properties":{"path":{"format":"path","description":"The parent directory's absolute directory path.","example":"/home/example","type":"string"},"state":{"description":"An object containing the parent directory's leech protection information.","properties":{"has_leech_protection":{"example":"1","enum":["1","0"],"description":"The parent directory's leech protection status.\n\n* `1` — Leech protection is enabled.\n* `0` — Leech protection is disabled.","type":"integer"}},"type":"object"}},"type":"object"},"children":{"type":"array","description":"A list of subdirectories and their leech protection information.\n\n**Note:**\n\nThe function returns a list for each subdirectory in a directory.","items":{"properties":{"path":{"type":"string","format":"path","description":"The subdirectory's absolute directory path.","example":"/home/example/example.com/cgi-bin"},"state":{"description":"A object containing the subdirectory's leech protection information.","type":"object","properties":{"has_leech_protection":{"enum":["1","0"],"example":"1","description":"The directory's leech protection status.\n\n* `1` — Leech protection is enabled.\n* `0` — Leech protection is disabled.","type":"integer"}}}},"type":"object"}},"home":{"description":"The user's `home` directory and its leech protection information.","type":"object","properties":{"path":{"format":"path","description":"The `home` directory's absolute directory path.","example":"/home/example","type":"string"},"state":{"type":"object","properties":{"has_leech_protection":{"type":"integer","example":"1","enum":["1","0"],"description":"The home directory's leech protection status.\n\n* `1` — Leech protection is enabled.\n* `0` — Leech protection is disabled."}},"description":"A object containing the `home` directory's leech protection information."}}},"current":{"type":"object","properties":{"state":{"type":"object","properties":{"has_leech_protection":{"description":"The current directory's leech protection status.\n\n* `1` — Leech protection is enabled.\n* `0` — Leech protection is disabled.","example":"1","enum":["1","0"],"type":"integer"}},"description":"An object containing the current directory's leech protection information."},"path":{"type":"string","format":"path","description":"The current directory's absolute file path.","example":"/home/example/example.com"}},"description":"The user's current directory and its leech protection information."}}},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}}},"module":{"example":"DirectoryProtection","description":"The name of the module called.","type":"string"}},"type":"object"}}}}},"description":"This function returns the\n[leech protection](https://go.cpanel.net/cpaneldocsLeechProtection)\nsettings of the subdirectories in a directory.","operationId":"DirectoryProtection-list_directories","parameters":[{"required":"true","name":"dir","in":"query","schema":{"format":"path","example":"/home/example/example.com","type":"string"},"description":"The absolute or relative file path in the user's `home` directory for which to return leech protection information."}],"x-cpanel-api-version":"UAPI","summary":"Return Directory Protection settings","tags":["DirectoryProtection","Directory Protection"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryProtection \\\n  list_directories \\\n  dir='/home/example/example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryProtection/list_directories?dir=%2fhome%2fexample%2fexample.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryProtection_list_directories.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryProtection_list_directories.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/DirectoryProtection/,\n    q/list_directories/,\n    {\n        'dir' => '/home/example/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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryProtection_list_directories.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryProtection_list_directories.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    'DirectoryProtection',\n    'list_directories',\n    array (\n        'dir' => '/home/example/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}"}]}}},"tags":[{"name":"DirectoryProtection","description":"The DirectoryProtection module for UAPI."},{"description":"Directory Management / Directory Protection","name":"Directory Protection"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}}},"Mailboxes":{"get_mailbox_status_list":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"tags":[{"description":"The Mailboxes module for UAPI.","name":"Mailboxes"},{"name":"Mailbox Management","description":"Email / Mailbox Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"tags":["Mailbox Management"],"name":"Email"}],"paths":{"/Mailboxes/get_mailbox_status_list":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return cPanel account's mailbox status","tags":["Mailboxes","Mailbox Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mailboxes \\\n  get_mailbox_status_list \\\n  account='user@example.com'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Mailboxes/get_mailbox_status_list?account=user%40example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mailboxes_get_mailbox_status_list.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mailboxes_get_mailbox_status_list.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/Mailboxes/,\n    q/get_mailbox_status_list/,\n    {\n        'account' => 'user@example.com',\n    }\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mailboxes_get_mailbox_status_list.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mailboxes_get_mailbox_status_list.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    'Mailboxes',\n    'get_mailbox_status_list',\n    array (\n        'account' => 'user@example.com',\n    )\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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"data":{"example":[{"messages":"0","guid":"1234560f0c58d158c92a000044f0d230","vsize":"0","mailbox":"INBOX.marla_singer@example_com"},{"mailbox":"INBOX.angel_face@example_com","guid":"11234560f0c58d158c92a000044f0d23","vsize":"0","messages":"0"},{"messages":"0","guid":"111234560f0c58d158c92a000044f0d2","vsize":"0","mailbox":"INBOX.tyler_durden@example_com"},{"messages":"0","vsize":"0","guid":"1111234560f0c58d158c92a000044f0d","mailbox":"INBOX.Trash"},{"messages":"0","mailbox":"INBOX.narrator@example_com","vsize":"0","guid":"11111234560f0c58d158c92a000044f0"},{"messages":"0","vsize":"0","guid":"111111234560f0c58d158c92a000044f","mailbox":"INBOX"},{"mailbox":"INBOX.Sent","guid":"1111111234560f0c58d158c92a000004","vsize":"0","messages":"0"},{"vsize":"0","guid":"11111111234560f0c58d158c92a00000","mailbox":"INBOX.Drafts","messages":"0"},{"messages":"0","mailbox":"INBOX.robert_paulsen@example_com","guid":"111111111234560f0c58d158c92a0000","vsize":"0"}],"items":{"type":"object","properties":{"guid":{"example":"1234560f0c58d158c92a000044f0d230","description":"The mailbox GUID.","type":"string"},"vsize":{"minimum":"0","type":"integer","example":"1052299","description":"The size of the folder, in bytes.","format":"bytes"},"mailbox":{"type":"string","description":"The mailbox name.","example":"INBOX.marla_singer@example_com"},"messages":{"minimum":"0","type":"integer","example":"410","description":"The number of messages in the folder."}}},"type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"Mailboxes","type":"string"},"func":{"description":"The name of the method called.","example":"get_mailbox_status_list","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 64","parameters":[{"required":"true","in":"query","name":"account","schema":{"type":"string","example":"user@example.com"},"description":"The email account for which you you wish to request the status."}],"description":"This function lists the account's mailbox size and globally unique identifier (GUID) by folder.","operationId":"get_mailbox_status_list"}}}},"set_utf8_mailbox_names":{"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mailboxes","description":"The Mailboxes module for UAPI."},{"name":"Mailbox Management","description":"Email / Mailbox Management"}],"paths":{"/Mailboxes/set_utf8_mailbox_names":{"get":{"parameters":[{"description":"Whether to enable or disable UTF-8 character-encoded mailbox\nnames.\n\n* `1` - Enable UTF-8 encoded mailbox names.\n* `0` - Disable UTF-8 encoded mailbox names.","schema":{"type":"integer","enum":["0","1"],"example":"1"},"in":"query","name":"enabled","required":"true"}],"description":"This function enables or disables UTF-8-encoded mailbox names on Roundcube webmail for a cPanel user's email accounts.","operationId":"set_utf8_mailbox_names","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"set_utf8_mailbox_names"},"result":{"type":"object","properties":{"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"object","properties":{"success":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the system changed mailbox name setting's status.\n* `1` - Success.\n* `0` - Failure."}}},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","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.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"Mailboxes","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 78","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mailboxes \\\n  set_utf8_mailbox_names \\\n  enabled='1'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mailboxes/set_utf8_mailbox_names?enabled=1"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mailboxes_set_utf8_mailbox_names.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mailboxes_set_utf8_mailbox_names.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/Mailboxes/,\n    q/set_utf8_mailbox_names/,\n    {\n        'enabled' => '1',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mailboxes_set_utf8_mailbox_names.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mailboxes_set_utf8_mailbox_names.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    'Mailboxes',\n    'set_utf8_mailbox_names',\n    array (\n        'enabled' => '1',\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}"}],"tags":["Mailboxes","Mailbox Management"],"summary":"Enable or disable Webmail mailbox UTF-8 encoding","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Email","tags":["Mailbox Management"]}]},"expunge_messages_for_mailbox_guid":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"name":"Email","tags":["Mailbox Management"]}],"paths":{"/Mailboxes/expunge_messages_for_mailbox_guid":{"get":{"parameters":[{"schema":{"anyOf":[{"format":"email","type":"string"},{"type":"string","format":"username"}]},"examples":{"email":{"value":"user@example.com","summary":"A valid email account."},"_mainaccount":{"summary":"The `_mainaccount` alias, which represents the cPanel user's mailbox.","value":"_mainaccount@example.com"},"cpanel-user":{"value":"example","summary":"The cPanel user's account name."}},"description":"The email account's name.","required":"true","name":"account","in":"query"},{"required":"true","name":"mailbox_guid","in":"query","schema":{"type":"string","example":"2550860f0c58d158c92a000044f0d230"},"description":"The mailbox's globally unique identifier (GUID).\n\nUse the `Mailboxes::get_mailbox_status_list` function to list possible values for the `mailbox_guid` parameter."},{"schema":{"example":"savedbefore 52w","type":"string"},"description":"The query to select which messages you wish to remove from the mailbox.","required":"true","in":"query","name":"query"}],"operationId":"expunge_messages_for_mailbox_guid","description":"This function marks the selected mailbox's messages as deleted.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"data":{"type":"object","properties":{}},"metadata":{"properties":{}},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"module":{"type":"string","description":"The name of the module called.","example":"Mailboxes"},"func":{"example":"expunge_messages_for_mailbox_guid","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 64","tags":["Mailboxes","Mailbox Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mailboxes \\\n  expunge_messages_for_mailbox_guid \\\n  account='_mainaccount@example.com' \\\n  mailbox_guid='2550860f0c58d158c92a000044f0d230' \\\n  query='savedbefore 52w'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mailboxes/expunge_messages_for_mailbox_guid?account=_mainaccount%40example.com&mailbox_guid=2550860f0c58d158c92a000044f0d230&query=savedbefore%2052w","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mailboxes_expunge_messages_for_mailbox_guid.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mailboxes_expunge_messages_for_mailbox_guid.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/Mailboxes/,\n    q/expunge_messages_for_mailbox_guid/,\n    {\n        'account' => '_mainaccount@example.com',\n        'mailbox_guid' => '2550860f0c58d158c92a000044f0d230',\n        'query' => 'savedbefore 52w',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mailboxes_expunge_messages_for_mailbox_guid.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mailboxes_expunge_messages_for_mailbox_guid.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    'Mailboxes',\n    'expunge_messages_for_mailbox_guid',\n    array (\n        'account' => '_mainaccount@example.com',\n        'mailbox_guid' => '2550860f0c58d158c92a000044f0d230',\n        'query' => 'savedbefore 52w',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Delete selected messages in mailbox by GUID"}}},"tags":[{"name":"Mailboxes","description":"The Mailboxes module for UAPI."},{"name":"Mailbox Management","description":"Email / Mailbox Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"has_utf8_mailbox_names":{"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Mailboxes module for UAPI.","name":"Mailboxes"},{"name":"Mailbox Management","description":"Email / Mailbox Management"}],"paths":{"/Mailboxes/has_utf8_mailbox_names":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return if cPanel account's mailboxes use UTF-8","tags":["Mailboxes","Mailbox Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mailboxes \\\n  has_utf8_mailbox_names\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Mailboxes/has_utf8_mailbox_names"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mailboxes_has_utf8_mailbox_names.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mailboxes_has_utf8_mailbox_names.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/Mailboxes/,\n    q/has_utf8_mailbox_names/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mailboxes_has_utf8_mailbox_names.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mailboxes_has_utf8_mailbox_names.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    'Mailboxes',\n    'has_utf8_mailbox_names'\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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"data":{"type":"object","properties":{"enabled":{"example":"1","enum":["0","1"],"description":"Whether the user currently uses UTF-8 character-encoded mailbox names.\n* `1` - Uses UTF-8 character-encoded mailbox names.\n* `0` - Does **not** use UTF-8 character-encoded mailbox names.","type":"integer"}}},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","example":"Mailboxes","description":"The name of the module called."},"func":{"type":"string","example":"has_utf8_mailbox_names","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 78","parameters":[{"required":"false","in":"query","name":"user","schema":{"example":"user","format":"username","type":"string"},"description":"The user for whom to determine whether they currently use UTF-8\ncharacter-encoded mailbox names.\n\n**Note:**\n\nThis parameter defaults to the currently-logged in user."}],"description":"This function determines whether a cPanel user currently uses UTF-8 character-encoded mailbox names.","operationId":"has_utf8_mailbox_names"}}},"x-tagGroups":[{"tags":["Mailbox Management"],"name":"Email"}]},"expunge_mailbox_messages":{"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"name":"Mailboxes","description":"The Mailboxes module for UAPI."},{"description":"Email / Mailbox Management","name":"Mailbox Management"}],"paths":{"/Mailboxes/expunge_mailbox_messages":{"get":{"summary":"Delete selected messages in mailbox","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mailboxes \\\n  expunge_mailbox_messages \\\n  account='_mainaccount@example.com' \\\n  mailbox='INBOX.user@example_com' \\\n  query='savedbefore 52w'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mailboxes/expunge_mailbox_messages?account=_mainaccount%40example.com&mailbox=INBOX.user%40example_com&query=savedbefore%2052w","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mailboxes_expunge_mailbox_messages.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mailboxes_expunge_mailbox_messages.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/Mailboxes/,\n    q/expunge_mailbox_messages/,\n    {\n        'account' => '_mainaccount@example.com',\n        'mailbox' => 'INBOX.user@example_com',\n        'query' => 'savedbefore 52w',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mailboxes_expunge_mailbox_messages.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mailboxes_expunge_mailbox_messages.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    'Mailboxes',\n    'expunge_mailbox_messages',\n    array (\n        'account' => '_mainaccount@example.com',\n        'mailbox' => 'INBOX.user@example_com',\n        'query' => 'savedbefore 52w',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mailboxes","Mailbox Management"],"x-cpanel-available-version":"cPanel 64","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"expunge_mailbox_messages"},"result":{"properties":{"data":{},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"Mailboxes","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"expunge_mailbox_messages","description":"This function marks the selected mail messages as deleted.","parameters":[{"name":"account","in":"query","required":"true","examples":{"cpanel-user":{"value":"example","summary":"The cPanel user's account name."},"_mainaccount":{"value":"_mainaccount@example.com","summary":"The `_mainaccount` alias, which represents the cPanel user's mailbox."},"email":{"summary":"A valid email account.","value":"user@example.com"}},"description":"The email account's name.","schema":{"anyOf":[{"type":"string","format":"email"},{"type":"string","format":"username"}]}},{"name":"mailbox","in":"query","required":"true","description":"The mailbox to operate on.\n\n**Note:**\n\n* Use the `Mailboxes::get_mailbox_status_list` function to list possible values for the mailbox parameter.\n* Because you cannot escape wildcard characters such as (`*`), we recommend that you use functions that use the `mailbox_guid` parameter instead. For example, the `Mailboxes::expunge_messages_for_mailbox_guid` function.","schema":{"type":"string","example":"INBOX.user@example_com"}},{"description":"The Dovecot query to execute.\n\n**Note:**\n\nThe query parameter prevents accidental removal of all messages in the mailbox. For more information, read Dovecot's [Search Query](http://wiki2.dovecot.org/Tools/Doveadm/SearchQuery) documentation.","schema":{"type":"string","example":"savedbefore 52w"},"name":"query","in":"query","required":"true"}]}}},"x-tagGroups":[{"tags":["Mailbox Management"],"name":"Email"}]}},"LogManager":{"list_archives":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"tags":[{"description":"The LogManager module for UAPI.","name":"LogManager"},{"name":"Logs","description":"Website Configuration / Logs"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Website Configuration","tags":["Logs"]}],"paths":{"/LogManager/list_archives":{"get":{"summary":"Return cPanel account's archive files list","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LogManager \\\n  list_archives\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/LogManager/list_archives","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\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/<theme-name>\n#    to .../frontend/<theme-name>/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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\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/<theme-name>\n//    to .../frontend/<theme-name>/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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["LogManager","Logs"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"LogManager","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"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":{"path":{"example":"/home/user/logs/domain.com-May-2019.gz","description":"The archive file's path.","type":"string"},"file":{"example":"domain.com-May-2019.gz","description":"The archive file's name.","type":"string"},"mtime":{"type":"integer","format":"unix_timestamp","description":"The archive file's last modified date.","example":"1557835866"}},"type":"object"},"type":"array"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}}},"func":{"example":"list_archives","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 82","parameters":[],"operationId":"LogManager_list_archives","description":"This function returns a list of the user's archive files."}}}},"get_settings":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/LogManager/get_settings":{"get":{"operationId":"LogManager_get_settings","description":"This function retrieves the account's log archival settings.","parameters":[],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"LogManager"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"type":"object","properties":{"using_default":{"enum":["1","0"],"example":"1","description":"Whether the user uses the server-wide default retention period.\n* `1` — Uses the server default.\n* `0` — Uses a custom retention value.","type":"integer"},"archive_logs":{"description":"Whether the system archives log files to your home directory.\n* `1` — Archives the logs.\n* `0` — Does **not** archive the logs.","example":"1","enum":["1","0"],"type":"integer"},"prune_archive":{"description":"Whether the system removes the previous month's archived log files from your home directory.\n* `1` — Removes the logs.\n* `0` — Does **not** remove the logs.","example":"1","enum":["1","0"],"type":"integer"},"retention_days":{"example":"30","description":"The number of days the system retains archived log files before automatic removal.\nA value of `0` means the system retains logs indefinitely.\nWhen the user has not set a custom value, this returns the server-wide default.","type":"integer"}}},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"get_settings","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LogManager \\\n  get_settings\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/LogManager/get_settings"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\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/<theme-name>\n#    to .../frontend/<theme-name>/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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\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/<theme-name>\n//    to .../frontend/<theme-name>/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}"}],"tags":["LogManager","Logs"],"summary":"Retrieve cPanel account's log archival settings","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Logs"],"name":"Website Configuration"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The LogManager module for UAPI.","name":"LogManager"},{"name":"Logs","description":"Website Configuration / Logs"}]},"set_settings":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"tags":[{"description":"The LogManager module for UAPI.","name":"LogManager"},{"name":"Logs","description":"Website Configuration / Logs"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Website Configuration","tags":["Logs"]}],"paths":{"/LogManager/set_settings":{"get":{"x-cpanel-api-version":"UAPI","summary":"Save cPanel account's log archive settings","tags":["LogManager","Logs"],"x-codeSamples":[{"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","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/LogManager/set_settings"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\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/<theme-name>\n#    to .../frontend/<theme-name>/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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\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/<theme-name>\n//    to .../frontend/<theme-name>/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-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"data":{},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}}}},"module":{"type":"string","description":"The name of the module called.","example":"LogManager"},"func":{"description":"The name of the method called.","example":"set_settings","type":"string"}},"type":"object"}}}}},"description":"This function saves the account's log archive settings.\n\n**Note:**\n\nYou **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\nsystem processes statistics.\n* `1` — Archive the logs.\n* `0` — Do **not** archive the logs.\n\n**Note:**\n\n* This parameter defaults to the `archive-logs` setting's value in the user's `~/.cpanel-logs` file.\n* 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.","schema":{"type":"integer","example":"1","enum":["0","1"]},"in":"query","name":"archive_logs","required":"false"},{"required":"false","name":"prune_archive","in":"query","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.\n* `1` — Remove the logs.\n* `0` — Do **not** remove the logs.\n\n**Note:**\n\n* This parameter defaults to the `remove-old-archived-logs` setting's value in the user's `~/.cpanel-logs` file.\n* 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."},{"schema":{"type":"integer","minimum":"-1","example":"30"},"description":"The number of days to retain archived log files before automatic removal.\n* `0` — Retain logs indefinitely.\n* `-1` — Clear the per-user override and revert to the server default.\n* Any positive integer — Retain logs for that many days.\n\nWhen not provided, the existing value is preserved.","required":"false","name":"retention_days","in":"query"}]}}}},"delete_archive":{"x-tagGroups":[{"tags":["Logs"],"name":"Website Configuration"}],"paths":{"/LogManager/delete_archive":{"get":{"summary":"Delete a log archive file","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LogManager \\\n  delete_archive \\\n  file=example.com-Aug-2024.gz\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/LogManager/delete_archive?file=example.com-Aug-2024.gz"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\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/<theme-name>\n#    to .../frontend/<theme-name>/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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\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/<theme-name>\n//    to .../frontend/<theme-name>/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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["LogManager","Logs"],"x-cpanel-available-version":"cPanel 136","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"delete_archive","description":"The name of the method called."},"result":{"type":"object","properties":{"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.\n","example":"1","enum":["0","1"],"type":"integer"},"data":{},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"LogManager","description":"The name of the module called."}}}}}}},"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:\n* Must reside in the user's `~/logs` directory.\n* Must end with `.gz`.\n* Must not contain path traversal characters.\n","schema":{"example":"example.com-Aug-2024.gz","type":"string"},"name":"file","in":"query","required":"true"}]}}},"tags":[{"name":"LogManager","description":"The LogManager module for UAPI."},{"name":"Logs","description":"Website Configuration / Logs"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"}},"TeamRoles":{"list_feature_descriptions":{"tags":[{"name":"Team Roles","description":"The Team Roles module for UAPI."}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Team Roles"],"name":"cPanel Account"}],"paths":{"/TeamRoles/list_feature_descriptions":{"get":{"operationId":"list_feature_descriptions","description":"This function gives a list of all team roles and their included features.","parameters":[],"x-cpanel-available-version":"108","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"list_feature_descriptions","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"$ref":"#/components/schemas/FeatureDescriptions"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","type":"array"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"example":"TeamRoles","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"tags":["Team Roles"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  TeamRoles \\\n  list_feature_descriptions\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/TeamRoles/list_feature_descriptions"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file TeamRoles_list_feature_descriptions.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/TeamRoles_list_feature_descriptions.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/TeamRoles/,\n    q/list_feature_descriptions/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file TeamRoles_list_feature_descriptions.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/TeamRoles_list_feature_descriptions.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    'TeamRoles',\n    'list_feature_descriptions'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"List all role feature descriptions"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.107.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{"FeatureDescriptions":{"properties":{"features":{"example":["Backup","MySQL® Databases","PHP"],"items":{"type":"string"},"description":"The list of features in a role.","type":"array"},"title":{"type":"string","example":"Database","description":"The role's title."},"id":{"type":"string","description":"The role's ID.","example":"database"}}}}}}},"DynamicDNS":{"list":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"tags":[{"description":"The DynamicDNS module for UAPI.","name":"DynamicDNS"},{"name":"Dynamic DNS","description":"DNS / Dynamic DNS"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Dynamic DNS"],"name":"DNS"}],"paths":{"/DynamicDNS/list":{"get":{"x-cpanel-available-version":"82","x-cpanel-api-version":"UAPI","summary":"Return Dynamic DNS domains","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"description":"The user’s DDNS domains.","items":{"properties":{"last_run_times":{"type":"array","description":"The most recent times when the web call ran.\n\n**Note:**\n\nThis list changes every time the web call runs,\neven if the domain’s IP address resolution does\n**not** change.","items":{"format":"unix_timestamp","type":"integer"}},"description":{"type":"string","description":"A user-editable string that describes the DDNS domain.","example":"My home network"},"created_time":{"type":"integer","format":"unix_timestamp","description":"The DDNS domain’s creation time."},"id":{"type":"string","description":"The domain’s DDNS ID.\n\n**Note:**\n\nThis ID goes into the URL that the client uses to\n[update the domain’s IP address\nresolution](https://go.cpanel.net/cpaneldocsdynamicdns).","example":"gziugyxxjwnamqtwysgmvrurplmafxpj"},"domain":{"description":"The domain.","format":"domain","example":"home.example.com","type":"string"},"last_update_time":{"format":"unix_timestamp","description":"The most recent update time for the\nDDNS domain.\n\n**Note:**\n\nThis value changes **only** when\nthe domain’s IP address resolution changes.","nullable":"true","type":"integer"}},"type":"object"},"type":"array"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"},"module":{"description":"The name of the module called.","example":"DynamicDNS","type":"string"},"func":{"description":"The name of the method called.","example":"list","type":"string"}},"type":"object"}}}}},"description":"This function lists the user’s Dynamic DNS (DDNS) domains.\n\n**Important:**\n\nWhen you disable the [_DNS_ role](https://go.cpanel.net/serverroles), the system disables this function.","operationId":"dynamicdns-list","tags":["DynamicDNS","Dynamic DNS"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DynamicDNS \\\n  list\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DynamicDNS/list"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DynamicDNS_list.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DynamicDNS_list.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/DynamicDNS/,\n    q/list/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DynamicDNS_list.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DynamicDNS_list.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    'DynamicDNS',\n    'list'\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}","lang":"PHP","label":"LiveAPI PHP"}]}}}},"delete":{"tags":[{"description":"The DynamicDNS module for UAPI.","name":"DynamicDNS"},{"name":"Dynamic DNS","description":"DNS / Dynamic DNS"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"tags":["Dynamic DNS"],"name":"DNS"}],"paths":{"/DynamicDNS/delete":{"get":{"description":"This function deletes an existing Dynamic DNS (DDNS) domain.\n\n**Important:**\n\nWhen you disable the [_DNS_ role](https://go.cpanel.net/serverroles), the system disables this function.","operationId":"dynamicdns-delete","parameters":[{"description":"The DDNS domain’s ID.","schema":{"type":"string","example":"ggiugyxxjwnkmqtwysgmvrurplmafxpq"},"name":"id","in":"query","required":"true"}],"x-cpanel-available-version":"82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"delete"},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"properties":{"deleted":{"description":"Whether a DDNS domain with the given ID existed for deletion.\n\n* `0` - No DDNS domain with the given ID existed.\n* `1` - A DDNS domain with the given ID existed but is now deleted.","example":"1","enum":["0","1"],"type":"number"}},"type":"object","description":"Information about the deletion."},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"DynamicDNS","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["DynamicDNS","Dynamic DNS"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DynamicDNS \\\n  delete \\\n  id='ggiugyxxjwnkmqtwysgmvrurplmafxpq'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DynamicDNS/delete?id=ggiugyxxjwnkmqtwysgmvrurplmafxpq"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DynamicDNS_delete.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DynamicDNS_delete.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/DynamicDNS/,\n    q/delete/,\n    {\n        'id' => 'ggiugyxxjwnkmqtwysgmvrurplmafxpq',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DynamicDNS_delete.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DynamicDNS_delete.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    'DynamicDNS',\n    'delete',\n    array (\n        'id' => 'ggiugyxxjwnkmqtwysgmvrurplmafxpq',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Delete Dynamic DNS domain"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"}},"create":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The DynamicDNS module for UAPI.","name":"DynamicDNS"},{"name":"Dynamic DNS","description":"DNS / Dynamic DNS"}],"paths":{"/DynamicDNS/create":{"get":{"parameters":[{"schema":{"format":"domain","example":"home.example.com","type":"string"},"description":"The fully-qualified domain name to create as a DDNS domain.","required":"true","in":"query","name":"domain"},{"in":"query","name":"description","required":"false","description":"A human-readable string that describes the domain.","schema":{"example":"Home network","type":"string"}}],"operationId":"dynamicdns-create","description":"This function creates a Dynamic DNS (DDNS) domain.\n\n**Important:**\n\nWhen you disable the [_DNS_ role](https://go.cpanel.net/serverroles), the system disables this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"data":{"description":"Information about the newly-created DDNS domain.","properties":{"created_time":{"description":"The creation time of the Dynamic DNS domain.","format":"unix_timestamp","type":"integer"},"id":{"description":"The DDNS domain’s ID.","example":"ggiugyxxjwnkmqtwysgmvrurplmafxpq","type":"string"}},"type":"object"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"}},"type":"object"},"module":{"description":"The name of the module called.","example":"DynamicDNS","type":"string"},"func":{"description":"The name of the method called.","example":"create","type":"string"}}}}}}},"x-cpanel-available-version":"82","tags":["DynamicDNS","Dynamic DNS"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DynamicDNS \\\n  create \\\n  domain='home.example.com'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DynamicDNS/create?domain=home.example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DynamicDNS_create.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DynamicDNS_create.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/DynamicDNS/,\n    q/create/,\n    {\n        'domain' => 'home.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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DynamicDNS_create.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DynamicDNS_create.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    'DynamicDNS',\n    'create',\n    array (\n        'domain' => 'home.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}"}],"x-cpanel-api-version":"UAPI","summary":"Create Dynamic DNS domain"}}},"x-tagGroups":[{"name":"DNS","tags":["Dynamic DNS"]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"recreate":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/DynamicDNS/recreate":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DynamicDNS \\\n  recreate \\\n  id='ggiugyxxjwnkmqtwysgmvrurplmafxpq'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DynamicDNS/recreate?id=ggiugyxxjwnkmqtwysgmvrurplmafxpq"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DynamicDNS_recreate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DynamicDNS_recreate.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/DynamicDNS/,\n    q/recreate/,\n    {\n        'id' => 'ggiugyxxjwnkmqtwysgmvrurplmafxpq',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DynamicDNS_recreate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DynamicDNS_recreate.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    'DynamicDNS',\n    'recreate',\n    array (\n        'id' => 'ggiugyxxjwnkmqtwysgmvrurplmafxpq',\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}"}],"tags":["DynamicDNS","Dynamic DNS"],"summary":"Update Dynamic DNS domain ID","x-cpanel-api-version":"UAPI","parameters":[{"description":"The DDNS domain’s ID.","schema":{"example":"ggiugyxxjwnkmqtwysgmvrurplmafxpq","type":"string"},"in":"query","name":"id","required":"true"}],"description":"This function gives a new, randomly-generated ID to an existing Dynamic DNS (DDNS) domain.\n\n**Important:**\n\nWhen you disable the [_DNS_ role](https://go.cpanel.net/serverroles), the system disables this function.","operationId":"dynamicdns-recreate","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"recreate","description":"The name of the method called.","type":"string"},"result":{"properties":{"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"description":"Information about the DDNS domain.","properties":{"id":{"type":"string","example":"ggiugyxxjwnkmqtwysgmvrurplmafxpq","description":"The DDNS domain’s new ID."}},"type":"object"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"DynamicDNS","description":"The name of the module called."}},"type":"object"}}}}},"x-cpanel-available-version":"82"}}},"x-tagGroups":[{"tags":["Dynamic DNS"],"name":"DNS"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The DynamicDNS module for UAPI.","name":"DynamicDNS"},{"name":"Dynamic DNS","description":"DNS / Dynamic DNS"}]},"set_description":{"x-tagGroups":[{"tags":["Dynamic DNS"],"name":"DNS"}],"paths":{"/DynamicDNS/set_description":{"get":{"x-cpanel-available-version":"82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","description":"The name of the module called.","example":"DynamicDNS"},"func":{"example":"list","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"description":"This function sets the description on a user’s Dynamic DNS (DDNS) domain.\n\n**Important:**\n\nWhen you disable the [_DNS_ role](https://go.cpanel.net/serverroles), the system disables this function.","operationId":"dynamicdns-set_description","parameters":[{"schema":{"type":"string","example":"ggiugyxxjwnkmqtwysgmvrurplmafxpq"},"description":"The DDNS domain’s ID.","required":"true","in":"query","name":"id"},{"name":"description","in":"query","required":"true","description":"A human-readable string that describes the domain.","schema":{"type":"string","example":"Home network"}}],"x-cpanel-api-version":"UAPI","summary":"Update Dynamic DNS domain description","tags":["DynamicDNS","Dynamic DNS"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DynamicDNS \\\n  set_description \\\n  id='ggiugyxxjwnkmqtwysgmvrurplmafxpq' \\\n  description='Home network'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DynamicDNS/set_description?id=ggiugyxxjwnkmqtwysgmvrurplmafxpq&description=Home%20network"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DynamicDNS_set_description.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DynamicDNS_set_description.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/DynamicDNS/,\n    q/set_description/,\n    {\n        'id' => 'ggiugyxxjwnkmqtwysgmvrurplmafxpq',\n        'description' => 'Home network',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DynamicDNS_set_description.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DynamicDNS_set_description.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    'DynamicDNS',\n    'set_description',\n    array (\n        'id' => 'ggiugyxxjwnkmqtwysgmvrurplmafxpq',\n        'description' => 'Home network',\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"tags":[{"name":"DynamicDNS","description":"The DynamicDNS module for UAPI."},{"name":"Dynamic DNS","description":"DNS / Dynamic DNS"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}}},"ExternalAuthentication":{"has_external_auth_modules_configured":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The ExternalAuthentication module for UAPI.","name":"ExternalAuthentication"},{"description":"Authentication / External Authentication","name":"External Authentication"}],"paths":{"/ExternalAuthentication/has_external_auth_modules_configured":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ExternalAuthentication \\\n  has_external_auth_modules_configured\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/has_external_auth_modules_configured","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ExternalAuthentication_has_external_auth_modules_configured.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_has_external_auth_modules_configured.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/ExternalAuthentication/,\n    q/has_external_auth_modules_configured/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ExternalAuthentication_has_external_auth_modules_configured.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_has_external_auth_modules_configured.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    'ExternalAuthentication',\n    'has_external_auth_modules_configured'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["ExternalAuthentication","External Authentication"],"summary":"Return external authentication user status","x-cpanel-api-version":"UAPI","description":"This function determines whether the user enabled external authentication modules.","operationId":"has_external_auth_modules_configured","parameters":[],"x-cpanel-available-version":"cPanel 66","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"has_external_auth_modules_configured","type":"string"},"module":{"type":"string","example":"ExternalAuthentication","description":"The name of the module called."},"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"integer","description":"Whether the cPanel user enabled any external modules.\n\n* `1` - Enabled.\n* `0` - **Not** enabled.\n\n**Note:**\n\nFor more information, read our [Password and Security](https://go.cpanel.net/cpaneldocsPasswordoutputampSecurity) and [External Authentication](https://go.cpanel.net/externalauth) FAQ documentation.","example":"1","enum":["0","1"]},"metadata":{"properties":{}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["External Authentication"],"name":"Authentication"}]},"remove_authn_link":{"tags":[{"name":"ExternalAuthentication","description":"The ExternalAuthentication module for UAPI."},{"name":"External Authentication","description":"Authentication / External Authentication"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["External Authentication"],"name":"Authentication"}],"paths":{"/ExternalAuthentication/remove_authn_link":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"remove_authn_link","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"data":{"nullable":"true","default":null,"type":"object"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"metadata":{"properties":{}}}},"module":{"example":"ExternalAuthentication","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","parameters":[{"name":"provider","in":"query","required":"true","description":"The name of the identity provider.","schema":{"type":"string","example":"cpanelid"}},{"description":"The unique identifier for the user at the identity provider.","schema":{"example":"123456789012345678901","type":"string"},"in":"query","name":"subject_unique_identifier","required":"true"}],"description":"This function removes a link to an account at an external authentication identity provider.","operationId":"remove_authn_link","x-cpanel-api-version":"UAPI","summary":"Remove external authentication link","tags":["ExternalAuthentication","External Authentication"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ExternalAuthentication \\\n  remove_authn_link \\\n  provider='cpanelid' \\\n  subject_unique_identifier='123456789012345678901'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/remove_authn_link?provider=cpanelid&subject_unique_identifier=123456789012345678901"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ExternalAuthentication_remove_authn_link.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_remove_authn_link.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/ExternalAuthentication/,\n    q/remove_authn_link/,\n    {\n        'provider' => 'cpanelid',\n        'subject_unique_identifier' => '123456789012345678901',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ExternalAuthentication_remove_authn_link.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_remove_authn_link.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    'ExternalAuthentication',\n    'remove_authn_link',\n    array (\n        'provider' => 'cpanelid',\n        'subject_unique_identifier' => '123456789012345678901',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}}},"configured_modules":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/ExternalAuthentication/configured_modules":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return server's external authentication providers","tags":["ExternalAuthentication","External Authentication"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ExternalAuthentication \\\n  configured_modules\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/configured_modules"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ExternalAuthentication_configured_modules.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_configured_modules.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/ExternalAuthentication/,\n    q/configured_modules/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ExternalAuthentication_configured_modules.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_configured_modules.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    'ExternalAuthentication',\n    'configured_modules'\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-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"configured_modules","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"ExternalAuthentication","description":"The name of the module called."},"result":{"properties":{"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"items":{"properties":{"icon":{"type":"string","example":"iVBORw0KGgoAAAANSUhEUgAAACMAAAAhCAYAAABTERJSAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMTNFRUVGMzIyODUxMUU1OUM1RERGODcwRjIwNTQ4MCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMTNFRUVGNDIyODUxMUU1OUM1RERGODcwRjIwNTQ4MCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjExM0VFRUYxMjI4NTExRTU5QzVEREY4NzBGMjA1NDgwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjExM0VFRUYyMjI4NTExRTU5QzVEREY4NzBGMjA1NDgwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+oa0v2AAAA3VJREFUeNrsWM1uFEcQruqent3Z9Y43DmuD2YT1LoIICSIgEULKC+SaF8gr5JAnyD3XKCcChxxyyhNYiFMU5ZRTzE8UuGCQY8DGeGd3Zqrydc/ajiWjBHCEpWxLPf1T01VfV/d09TesqnRUUuQfN+5tUzMylAsRM9EOPlTJV0V9qWQg3BgLXek4+mUtpxKy+bqhAvIcLxVSlT4FHVAQITegO7Z8vGFpqeW4P+N40Iy434rNR23Hcd3ymV0wL00TNIJH6UsY2syVsrICuTlWGFJyAJlYrtVj7jUi9gZhzPQSS4tJRO+1nF1C/aThoHFfgp7n+zzjZ+GNjUWDB7yHRPYAQQnV8MCMOu04ughvPEbzztV599UHbXvOGe7OwHhsKH3jZdrKiZwhgrtcYs0ilJ6A4ffhytMpZtmAa/3s4OYuQFhg/m75IX1xtm2/XKjbw90zn3Zr19+p81W4dr5mqP0vxslkOx3+Bu6n9jOsROttf02GjlCagpmCmYI5VDD8GuP0tYYdHP72HXq3N4prTcfHEA6ev8ir2OSjLwK0jkvRoRAjNmlkFG1aGAktPxrK6NZq/o3lwh1POPtkIQ4ncqm7Y2lcqua4o4zKKr4h66ggLrSSo2zinfUrnXgPzM9r+c0P51wySE22NhTBNUEQnVGqbuZSrm6LXJhzMkit/JmVdfT/vl1QcXej+H4r91cLyrtNW/ZmrG4AydORytMRyrHXpfJgq5TL70Zy+Vgs97JCnwS5yhOgRD3fAUP+coW8qa+Q4Kxr3/72Il0dFqEtPsuubLctupdflqSyHXBEkzvFq26AfYGS/7b4hg/YDNNPewpmCuZ/DwYn5I/rI7mLY/7ZW2eUy6ujz/0ZBZoSz8a8CB50ohkRqIo57QkZiNhS6mw/qaiKwYHmySXzfwGmorZKw1LGOjb3s7K8r8o/CRXhIPXZU9Sa5Q441aVByz5CoMtXnpVfyyydQ4DtQt4DzXkjhsE+JvzwRxZ4smeToKehHpgtVzxbAuPUwDwR2Oj8XES/rueB5nbqDJCeBJo6xvZmQG8bEQ1mY3Mqifgk+jzb9H3dgzzp6S3603/m2hOv+OwmRDnFTQHLFdaphWAL8h68mpWSbRW08lBoxf8I8IQfohCrEu9VLD1Yqmel/TQOSz5oxfzxrDN2h5TyUfolcqQ+7b8EGACd0Ob6pUnq9QAAAABJRU5ErkJggg==","description":"The icon file to display on the button in the cPanel login interface.","format":"base64 image"},"provider_name":{"type":"string","example":"cpanelid","description":"The identity provider's system name."},"textcolor":{"example":"FFFFFF","description":"The color of the text label in the cPanel login interface.","format":"RGB","type":"string"},"icon_type":{"description":"The icon file's MIME type.","format":"MIME","example":"image/svg+xml","type":"string"},"label":{"type":"string","example":"Log in with a cPanel ID Account","description":"The text label of the login icon in the cPanel login interface."},"link":{"type":"string","example":"https://hostname.example.com:2083/openid_connect/cpanelid","description":"link to the identity provider's configuration for the appropriate service on the system.","format":"url"},"color":{"type":"string","description":"The background color of the button on the cPanel interface.","format":"RGB","example":"00aef0"},"display_name":{"type":"string","example":"cPanel ID","description":"The identity provider's friendly name. cPanel & WHM interfaces will display this value."},"documentation_url":{"type":"string","example":"https://go.cpanel.net/OpenIDConnect","format":"url","description":"The public URL of the identity provider's implementation documentation."}},"type":"object"},"type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- `1` - Success\n- `0` - Failed. Check the `errors` field for more details."},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}}}},"operationId":"configured_modules","description":"This function lists the display information for your server's available and configured external authentication identity provider modules.","parameters":[]}}},"x-tagGroups":[{"name":"Authentication","tags":["External Authentication"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"description":"The ExternalAuthentication module for UAPI.","name":"ExternalAuthentication"},{"name":"External Authentication","description":"Authentication / External Authentication"}]},"get_authn_links":{"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The ExternalAuthentication module for UAPI.","name":"ExternalAuthentication"},{"name":"External Authentication","description":"Authentication / External Authentication"}],"paths":{"/ExternalAuthentication/get_authn_links":{"get":{"description":"This function lists the external authentication links to the current cPanel account.","operationId":"get_authn_links","parameters":[],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"example":"1","enum":["0","1"],"description":"* 1 — Success\n* 0 — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"type":"array","items":{"type":"object","properties":{"preferred_username":{"description":"The preferred username of the account on the identity provider.","example":"username@gmail.com","type":"string"},"provider_protocol":{"type":"string","description":"The identity provider's protocol.","example":"openid_connect"},"subject_unique_identifier":{"type":"integer","example":"123456789012346","description":"The unique identifier for the user at the identity provider."},"link_time":{"type":"integer","description":"When the user linked their account to the identity provider.","format":"unix_timestamp","example":"1443124604"},"provider_id":{"example":"google","description":"The system's unique key for the identity provider.","type":"string"}}}}}},"module":{"type":"string","example":"ExternalAuthentication","description":"The name of the module called."},"func":{"example":"get_authn_links","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["ExternalAuthentication","External Authentication"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ExternalAuthentication \\\n  get_authn_links\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/get_authn_links"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ExternalAuthentication_get_authn_links.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_get_authn_links.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/ExternalAuthentication/,\n    q/get_authn_links/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ExternalAuthentication_get_authn_links.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_get_authn_links.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    'ExternalAuthentication',\n    'get_authn_links'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return external authentication links"}}},"x-tagGroups":[{"name":"Authentication","tags":["External Authentication"]}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"add_authn_link":{"paths":{"/ExternalAuthentication/add_authn_link":{"get":{"parameters":[{"required":"true","in":"query","name":"username","schema":{"type":"string","format":"username","example":"example"},"description":"The username."},{"description":"The name of the identity provider.","schema":{"example":"google","type":"string"},"name":"provider_id","in":"query","required":"true"},{"required":"true","in":"query","name":"subject_unique_identifier","schema":{"type":"string","example":"123456789012345678901"},"description":"The unique identifier for the user at the identity provider."},{"required":"true","name":"preferred_username","in":"query","schema":{"type":"string","example":"Example"},"description":"The preferred username of the account on the identity provider."}],"description":"This function adds an External Authentication authorization link to an account.","operationId":"add_authn_link","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"add_authn_link","type":"string"},"result":{"properties":{"data":{"type":"object","nullable":"true","default":null},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- `1` - Success\n- `0` - Failed. Check the `errors` field for more details."},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","description":"The name of the module called.","example":"ExternalAuthentication"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ExternalAuthentication \\\n  add_authn_link \\\n  username='example' \\\n  provider_id='google' \\\n  subject_unique_identifier='123456789012345678901' \\\n  preferred_username='Example'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/add_authn_link?username=example&provider_id=google&subject_unique_identifier=123456789012345678901&preferred_username=Example","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ExternalAuthentication_add_authn_link.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_add_authn_link.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/ExternalAuthentication/,\n    q/add_authn_link/,\n    {\n        'username' => 'example',\n        'provider_id' => 'google',\n        'subject_unique_identifier' => '123456789012345678901',\n        'preferred_username' => 'Example',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ExternalAuthentication_add_authn_link.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_add_authn_link.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    'ExternalAuthentication',\n    'add_authn_link',\n    array (\n        'username' => 'example',\n        'provider_id' => 'google',\n        'subject_unique_identifier' => '123456789012345678901',\n        'preferred_username' => 'Example',\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}"}],"tags":["ExternalAuthentication","External Authentication"],"summary":"Add external authentication link","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Authentication","tags":["External Authentication"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"name":"ExternalAuthentication","description":"The ExternalAuthentication module for UAPI."},{"name":"External Authentication","description":"Authentication / External Authentication"}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}}},"DNSSEC":{"add_zone_key":{"paths":{"/DNSSEC/add_zone_key":{"get":{"x-cpanel-api-version":"UAPI","summary":"Create DNSSEC security key","tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  add_zone_key \\\n  domain='example.com' \\\n  algo_num='8' \\\n  key_type='ksk'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/add_zone_key?domain=example.com&algo_num=8&key_type=ksk"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_add_zone_key.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_add_zone_key.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/DNSSEC/,\n    q/add_zone_key/,\n    {\n        'domain' => 'example.com',\n        'algo_num' => '8',\n        'key_type' => 'ksk',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_add_zone_key.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_add_zone_key.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    'DNSSEC',\n    'add_zone_key',\n    array (\n        'domain' => 'example.com',\n        'algo_num' => '8',\n        'key_type' => 'ksk',\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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"add_zone_key","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"DNSSEC"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"properties":{"error":{"type":"string","description":"An error message that describes why the system could not add the security key.\n\n**Note:**\n\nThe function **only** displays this return when the `success` return is a `0` value.","example":"Error: Invalid key_id or domain specified: No such key present for domain."},"success":{"type":"integer","description":"Whether the system added the security key.\n\n* `1` — The system added the security key.\n* `0` — The system failed to add the security key.","enum":["1","0"],"example":"1"},"domain":{"type":"string","description":"The domain for which the system added a security key.","format":"domain","example":"example.com"},"new_key_id":{"description":"The security key's ID.","example":"1","type":"string"}},"type":"object"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 84","parameters":[{"in":"query","name":"domain","required":"true","description":"The domain on which to enable DNSSEC.","schema":{"example":"example.com","format":"domain","type":"string"}},{"description":"The algorithm that the system uses to generate the security key.\n\n* `5` — RSA/SHA-1\n* `6` — DSA-NSEC3-SHA1\n* `7` — RSASHA1-NSEC3-SHA1\n* `8` — RSA/SHA-256\n* `10` — RSA/SHA-512\n* `13` — ECDSA Curve P-256 with SHA-256\n* `14` — ECDSA Curve P-384 with SHA-384\n\n**Note:**\n\nWe recommend that you use 'ECDSA Curve P-256 with SHA-256' if your registrar supports it.","schema":{"enum":["5","6","7","8","10","13","14"],"example":"8","type":"integer"},"name":"algo_num","in":"query","required":"true"},{"description":"The type of key to add.\n\n* `ksk`\n* `zsk`","schema":{"enum":["ksk","zsk"],"example":"ksk","type":"string"},"in":"query","name":"key_type","required":"true"},{"schema":{"maximum":"2048","type":"integer","minimum":"256","example":"2048"},"description":"The key's size, in bits.\n\n**Note:**\n\nFor the following `algo_num` and `key_type` parameters, the `key_size` defaults to the following values:\n* `5` — ksk `2048` zsk `1024`\n* `6` — ksk `2048` zsk `1024`\n* `7` — ksk `2048` zsk `1024`\n* `8` — ksk `2048` zsk `1024`\n* `10` — ksk `2048` zsk `1024`\n* `13` — ksk `256` zsk `256`\n* `14` — ksk `384` zsk `384` ","required":"false","in":"query","name":"key_size"},{"name":"active","in":"query","required":"false","description":"Whether to activate the newly-created key.\n\n* `1` — Activate the key.\n* `0` — Do **not** activate the key.","schema":{"type":"integer","enum":["0","1"],"example":"1","default":"1"}}],"operationId":"add_zone_key","description":"This function generates a DNSSEC zone key for a domain.\n\n**Note:**\n\n* After you enable DNSSEC on the domain, you **must** add the DS records to your registrar.\n* You **cannot** modify the DNSSEC security key. To make any changes, you **must** disable (and delete) and re-create the DNSSEC security key.\n\n**Important:**\n\nWhen you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function."}}},"x-tagGroups":[{"name":"DNS","tags":["DNS Security"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"name":"DNS Security","description":"DNS / DNS Security"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"import_zone_key":{"paths":{"/DNSSEC/import_zone_key":{"get":{"x-cpanel-api-version":"UAPI","summary":"Add DNSSEC security key","tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  import_zone_key \\\n  domain='example.com' \\\n  key_type='ksk' \\\n  key_data=$'Private-key-format:%20v1.2%0AAlgorithm:%2013%20\\\\(ECDSAP256SHA256\\\\)%0APrivateKey:%20xCM281KtWE9oCsUX8fP1hDZ02/X7JCjp4QZA/DZjfX0=%0A%0A'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/import_zone_key?domain=example.com&key_type=ksk&key_data=Private-key-format%3a%2520v1.2%250AAlgorithm%3a%252013%2520%5c%28ECDSAP256SHA256%5c%29%250APrivateKey%3a%2520xCM281KtWE9oCsUX8fP1hDZ02%2fX7JCjp4QZA%2fDZjfX0%3d%250A%250A"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_import_zone_key.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_import_zone_key.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/DNSSEC/,\n    q/import_zone_key/,\n    {\n        'domain' => 'example.com',\n        'key_type' => 'ksk',\n        'key_data' => 'Private-key-format:%20v1.2%0AAlgorithm:%2013%20\\(ECDSAP256SHA256\\)%0APrivateKey:%20xCM281KtWE9oCsUX8fP1hDZ02/X7JCjp4QZA/DZjfX0=%0A%0A',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_import_zone_key.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_import_zone_key.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    'DNSSEC',\n    'import_zone_key',\n    array (\n        'domain' => 'example.com',\n        'key_type' => 'ksk',\n        'key_data' => 'Private-key-format:%20v1.2%0AAlgorithm:%2013%20\\(ECDSAP256SHA256\\)%0APrivateKey:%20xCM281KtWE9oCsUX8fP1hDZ02/X7JCjp4QZA/DZjfX0=%0A%0A',\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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"DNSSEC","type":"string"},"result":{"type":"object","properties":{"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"data":{"example":{"success":"1","new_key_id":"1","domain":"example.com"},"type":"object","properties":{"success":{"description":"Whether the system imported the security key.\n\n* `1` - The system imported the security key.\n* `0` - The system **failed** to import the security key.","enum":["0","1"],"example":"1","type":"integer"},"domain":{"type":"string","description":"The domain for which the system imported the zone key.","format":"domain","example":"example.com"},"new_key_id":{"example":"1","description":"The security key's ID.","type":"string"},"error":{"description":"An error message that describes why the system could not import the security key.\n\n**Note:**\n\nThe function **only** displays this return when the `success` return is a `0` value.","example":"Error: Invalid key_id or domain specified: No such key present for domain.","type":"string"}}},"metadata":{"properties":{}},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"description":"The name of the method called.","example":"import_zone_key","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 84","parameters":[{"required":"true","name":"domain","in":"query","schema":{"example":"example.com","format":"domain","type":"string"},"description":"The security key's domain."},{"in":"query","name":"key_type","required":"true","description":"The security key's type.\n\n* `ksk`\n* `zsk`","schema":{"enum":["ksk","zsk"],"example":"ksk","type":"string"}},{"required":"true","name":"key_data","in":"query","schema":{"example":"Private-key-format:%20v1.2%0AAlgorithm:%2013%20\\(ECDSAP256SHA256\\)%0APrivateKey:%20xCM281KtWE9oCsUX8fP1hDZ02/X7JCjp4QZA/DZjfX0=%0A%0A","type":"string"},"description":"The security key data that the [`pdnsutil`](https://doc.powerdns.com/authoritative/manpages/pdnsutil.1.html)\nutility's `export-zone-key` call returns."}],"operationId":"import_zone_key","description":"This function imports a DNSSEC security key.\n\n**Important:**\n\nWhen you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function."}}},"x-tagGroups":[{"tags":["DNS Security"],"name":"DNS"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"name":"DNS Security","description":"DNS / DNS Security"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"fetch_ds_records":{"paths":{"/DNSSEC/fetch_ds_records":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return domain's DS records","tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  fetch_ds_records \\\n  domain='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/fetch_ds_records?domain=example.com","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_fetch_ds_records.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_fetch_ds_records.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/DNSSEC/,\n    q/fetch_ds_records/,\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_fetch_ds_records.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_fetch_ds_records.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    'DNSSEC',\n    'fetch_ds_records',\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}"}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"DNSSEC","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"data":{"properties":{"additionalProperties":{"type":"object","properties":{"nsec_details":{"description":"An object containing the [Next Secure Record](https://tools.ietf.org/html/rfc4470) (NSEC) information for the selected domain.\n\n**Note:**\n\n If the domain uses NSEC semantics, only the `nsec_version` return appears in the object.","properties":{"nsec3_narrow":{"example":"1","enum":["0","1"],"description":"Whether NSEC3 will operate in Narrow or Inclusive mode.\n\n* `1` - Narrow mode.\n* `0` - Inclusive mode.\n\n**Note:**\n\n For more information about these modes, read [PowerDNS's DNSSEC documentation](https://doc.powerdns.com/authoritative/dnssec/intro.html).","type":"integer"},"nsec3_iterations":{"description":"The number of times that the system rehashes the first hash operation.","example":"12","type":"integer"},"nsec3_hash_algo_desc":{"description":"A description of the NSEC3 key's algorithm.","example":"SHA-1","type":"string"},"nsec3_salt":{"example":"fa1ac2c1rd7fbab4","description":"The salt value that PowerDNS uses in the hashes.\n\n**Note:**\n\n For more information about the salt value, read [RFC 5155](https://tools.ietf.org/html/rfc5155#section-3.1.5).","format":"hex","type":"string"},"nsec_version":{"type":"string","example":"NSEC","enum":["NSEC","NSEC3"],"description":"Whether the domain uses NSEC or [Next Secure Record version 3](https://tools.ietf.org/html/rfc5155) (NSEC3) [Domain Name Security Extensions](https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions) (DNSSEC) semantics.\n\n* `NSEC`\n* `NSEC3`"},"nsec3_hash_algo_num":{"type":"integer","description":"The DNSSEC Digest Algorithm Number.","example":"1"},"nsec3_opt_out":{"type":"integer","description":"Whether NSEC3 will create records for all delegations or only for secure delegations.\n\n* `1` - Create records for all delegations.\n* `0` - Create records only for secure delegations.","enum":["0","1"],"example":"1"}},"type":"object"},"keys":{"description":"The DS keys on the requested domain.","properties":{"additionalProperties":{"description":"The information related to the domain's DNSSEC record.\n\n**Note:**\n\nThe return's name is the `key_tag` return's integer value.","type":"object","properties":{"algo_desc":{"example":"RSA/SHA-256","description":"A description of the algorithm\nthat the DS key uses.","type":"string"},"key_type":{"type":"string","description":"The DS key's signing type.\n* `CSK` - Combined Signing Key.\n* `KSK` - Key Signing Key.\n* `ZSK` - Zone Signing Key.","example":"KSK","enum":["CSK","KSK","ZSK"]},"key_id":{"minimum":"1","type":"integer","description":"PowerDNS's internal identifier.","example":"1"},"key_tag":{"example":"34519","description":"The DS key's identification number.","type":"integer","minimum":"1"},"algo_tag":{"type":"string","description":"The short-form reference to the algorithm.","example":"RSASHA256"},"created":{"type":"integer","example":"1590002705","description":"The key's creation time.","format":"unix_timestamp"},"flags":{"description":"An integer that determines the `key_type` value.\n\n* `256` - A Zone Signing Key (ZSK).\n* `257` - A Combined Signing Key (CSK) or Key Signing Key (KSK).","example":"257","enum":["256","257"],"type":"integer"},"digests":{"description":"The information that\n the registrar uses to populate the DS records.","items":{"type":"object","properties":{"algo_desc":{"type":"string","example":"SHA-256","description":"A description of the algorithm\n that the DS key uses."},"algo_num":{"description":"A IETF-recognized DNSSEC Algorithm Number.","example":"2","minimum":"1","type":"integer"},"digest":{"description":"The actual digest in the DS record.","example":"4de3e58f1238fb7fc7caa84389ef6fa27d42572c35f1152c7f2ea3b899400019","type":"string"}}},"type":"array"},"active":{"example":"1","enum":["0","1"],"description":"Whether the DS key is active.\n\n* `1` - Active.\n* `0` - Inactive.","type":"integer"},"privatekey":{"type":"string","example":"Private-key-format: v1.2\nAlgorithm: 8 (RSASHA256)\nModulus: wcZl882v587qKmt3M7+y6u+kzSgCvfgyiSGQHE2EulDcAnfEmz/ryanXMveHGBsO4L/GynYYUUsGvD2jHK1ITh8CeISiqmbUmPolf9HLQgwcT5pVcvwJ0Wmzpw5Ukmx67N7TTX+yieI5OyflP23GnJYQ5EQUzBu/DhdxhL90hYU=\nPublicExponent: AQAB\nPrivateExponent: EnoBdKrTMA5Jw7u1hQitXbt2Al3jTQvifbLmk9xMYJufLtkOtSL2L6dzLpftmL3TwFho8xspnG7D+KUD7ZMURrwxnLlqTttaL2PeaYJdQ184ezuflExppkDkdTEOqcIUuSylfAbyIdeGkVFuWr0cdjM9OFKMAkoYaVeAUP0SYU0=\nPrime1: 4eslxBBwyvXzmFqKx5TTiHfU7EHIAxUru3ykOMqD2tVMHbRAq5AMKZL6ZhuTXk8mnGppEfC6qqNKnf3VT5jLxw==\nPrime2: 25OUAsWWAJrQ4uLytsXoSbjHsVyh61DgZ4S4n2Mv7RsSHt0Q/VcuyvHXuAKb8Y0XCYczZBtEW+ZoPte/HHnsUw==\nExponent1: Xkb4AqLtvvT2i8y0/2avA9MmCtXEtuydzGbOTVjNv4OlePvgxPee67aHQhcd34xeS4XohPEVpOHx4I6t9sKHvw==\nExponent2: ulZDBRcodNrs6Z4u22yX8/gbfyhdQJUh2reG9bv2sAB/wEJaaKPT0eXqav3L2PKfCjbyJcH+AP9G+A2e4UuWgQ==\nCoefficient: mynNLSgStpQMktIEdysefyOg5jpXE3VeDZF6fbEOUg+E2ZnLBkLu4KPrriCwfl+cLagwgzx2M6wV/1QWkm8vPQ==","description":"The DS key's private key, in ISC format."},"algo_num":{"enum":["5","6","7","8","10","13","14"],"example":"8","description":"The algorithm the system generated for the security key.\n\n* `5` - RSA/SHA-1\n* `6` - DSA-NSEC3-SHA1\n* `7` - RSASHA1-NSEC3-SHA1\n* `8` - RSA/SHA-256\n* `10` - RSA/SHA-512\n* `13` - ECDSA Curve P-256 with SHA-256\n* `14` - ECDSA Curve P-384 with SHA-384","type":"integer"},"bits":{"description":"The DS key's size, in bits.","example":"2048","type":"integer","minimum":"1","multipleOf":"64"}}}},"type":"object"}},"description":"An object containing the domain's DS record information.\n\n**Note:**\n\nThe return's name is the domain's name."}},"type":"object","example":{"example.com":{"keys":{"33930":{"algo_num":"8","bits":"1024","created":"1590002705","privatekey":"Private-key-format: v1.2\nAlgorithm: 8 (RSASHA256)\nModulus: wcZl882v587qKmt3M7+y6u+kzSgCvfgyiSGQHE2EulDcAnfEmz/ryanXMveHGBsO4L/GynYYUUsGvD2jHK1ITh8CeISiqmbUmPolf9HLQgwcT5pVcvwJ0Wmzpw5Ukmx67N7TTX+yieI5OyflP23GnJYQ5EQUzBu/DhdxhL90hYU=\nPublicExponent: AQAB\nPrivateExponent: EnoBdKrTMA5Jw7u1hQitXbt2Al3jTQvifbLmk9xMYJufLtkOtSL2L6dzLpftmL3TwFho8xspnG7D+KUD7ZMURrwxnLlqTttaL2PeaYJdQ184ezuflExppkDkdTEOqcIUuSylfAbyIdeGkVFuWr0cdjM9OFKMAkoYaVeAUP0SYU0=\nPrime1: 4eslxBBwyvXzmFqKx5TTiHfU7EHIAxUru3ykOMqD2tVMHbRAq5AMKZL6ZhuTXk8mnGppEfC6qqNKnf3VT5jLxw==\nPrime2: 25OUAsWWAJrQ4uLytsXoSbjHsVyh61DgZ4S4n2Mv7RsSHt0Q/VcuyvHXuAKb8Y0XCYczZBtEW+ZoPte/HHnsUw==\nExponent1: Xkb4AqLtvvT2i8y0/2avA9MmCtXEtuydzGbOTVjNv4OlePvgxPee67aHQhcd34xeS4XohPEVpOHx4I6t9sKHvw==\nExponent2: ulZDBRcodNrs6Z4u22yX8/gbfyhdQJUh2reG9bv2sAB/wEJaaKPT0eXqav3L2PKfCjbyJcH+AP9G+A2e4UuWgQ==\nCoefficient: mynNLSgStpQMktIEdysefyOg5jpXE3VeDZF6fbEOUg+E2ZnLBkLu4KPrriCwfl+cLagwgzx2M6wV/1QWkm8vPQ==","active":"1","flags":"256","algo_tag":"RSASHA256","key_tag":"33930","algo_desc":"RSA/SHA-256","key_id":"2","key_type":"ZSK"},"nsec_details":{"nsec3_opt_out":"0","nsec3_narrow":"1","nsec3_hash_algo_desc":"SHA-1","nsec3_iterations":"3","nsec3_salt":"fa1ac2c1rd7fbab4","nsec3_hash_algo_num":"1","nsec_version":"NSEC3"}}}}},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"type":"string","example":"fetch_ds_records","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function fetches a domain's Delegation of Signing (DS) records.\n\n**Important:**\n\nWhen you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"fetch_ds_records","parameters":[{"in":"query","name":"domain","required":"true","examples":{"single":{"summary":"To fetch DS records on a single domain.","value":"example.com"},"multiple":{"value":"domain-0=example0.com&domain-1=example1.com&domain-2=example2.com","summary":"To fetch DS records on multiple domains."}},"description":"The domain from which to fetch DS records.\n\n**Note:**\n\n To enable DNSSEC on multiple domains, increment the parameter name. For example: `domain-0`, `domain-1`, `domain-2`.","schema":{"type":"string","format":"domain"}}]}}},"x-tagGroups":[{"tags":["DNS Security"],"name":"DNS"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"name":"DNS Security","description":"DNS / DNS Security"}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"set_nsec3":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"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/","version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"name":"DNS Security","description":"DNS / DNS Security"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["DNS Security"],"name":"DNS"}],"paths":{"/DNSSEC/set_nsec3":{"get":{"description":"This function configures the domain to use [Next Secure Record 3](https://tools.ietf.org/html/rfc4470) (NSEC3) semantics.\n\n**Important:**\n\n  When you disable the [DNS role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","operationId":"set_nsec3","parameters":[{"required":"true","in":"query","name":"domain","schema":{"format":"domain","example":"example.com","type":"string"},"description":"The domain on which to enable NSEC3 semantics."},{"description":"Whether the system will create records for all delegations.\n\n* `1` - Create records for all delegations.\n* `0` - Create records **only** for secure delegations.\n\n**Note:**\n\n  **Only** select `1` if you **must** create records for all delegations.","schema":{"type":"integer","enum":["0","1"],"example":"0"},"in":"query","name":"nsec3_opt_out","required":"true"},{"name":"nsec3_iterations","in":"query","required":"true","description":"The number of times that the system re-executes the first resource record hash operation.","schema":{"minimum":"0","type":"integer","maximum":"500","example":"7"}},{"description":"Whether NSEC3 will operate in Narrow mode or Inclusive mode. In Narrow mode, PowerDNS sends out white lies about the next secure record. Rather than query the resource record in the database, PowerDNS sends the hash plus 1 as the next secure record.\n* `1` - Narrow mode. * `0` - Inclusive mode.","schema":{"type":"integer","example":"1","enum":["0","1"]},"name":"nsec3_narrow","in":"query","required":"true"},{"description":"The salt value that PowerDNS uses in the hashes. For more information about the salt value, read the [RFC 5155 documentation](https://tools.ietf.org/html/rfc5155).\n\n **Note:**\n\n In cPanel & WHM version 132 and later, this parameter also accepts the literal value `-` to indicate no salt value.","schema":{"type":"string","example":"1A2B3C4D5E6F","format":"hex"},"in":"query","name":"nsec3_salt","required":"true"}],"x-cpanel-available-version":"cPanel 60","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"properties":{"enabled":{"type":"object","additionalProperties":{"type":"integer","description":"Whether the system enabled NSEC3 on the domain.\n\n  * `1` - Enabled.\n  * `0` - The system failed to enable NSEC3.","enum":["0","1"]},"description":"Contains the domains for which the system enabled NSEC3.\n\n**Note:**\n\nThis return's name is the `domain` parameter's value.","example":{"example1.com":"1"}}},"type":"object"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"DNSSEC","description":"The name of the module called."},"func":{"type":"string","example":"set_nsec3","description":"The name of the method called."}},"type":"object"}}}}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  set_nsec3 \\\n  domain='example.com' \\\n  nsec3_opt_out='0' \\\n  nsec3_iterations='0' \\\n  nsec3_narrow='1' \\\n  nsec3_salt='-'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/set_nsec3?domain=example.com&nsec3_opt_out=0&nsec3_iterations=0&nsec3_narrow=1&nsec3_salt=-","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_set_nsec3.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_set_nsec3.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/DNSSEC/,\n    q/set_nsec3/,\n    {\n        'domain' => 'example.com',\n        'nsec3_opt_out' => '0',\n        'nsec3_iterations' => '0',\n        'nsec3_narrow' => '1',\n        'nsec3_salt' => '-',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_set_nsec3.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_set_nsec3.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    'DNSSEC',\n    'set_nsec3',\n    array (\n        'domain' => 'example.com',\n        'nsec3_opt_out' => '0',\n        'nsec3_iterations' => '0',\n        'nsec3_narrow' => '1',\n        'nsec3_salt' => '-',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["DNSSEC","DNS Security"],"summary":"Update domain to use NSEC3","x-cpanel-api-version":"UAPI"}}}},"export_zone_key":{"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"name":"DNS Security","description":"DNS / DNS Security"}],"paths":{"/DNSSEC/export_zone_key":{"get":{"x-cpanel-api-version":"UAPI","summary":"Export DNSSEC security key","tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  export_zone_key \\\n  domain='example.com' \\\n  key_id='12345'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/export_zone_key?domain=example.com&key_id=12345"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_export_zone_key.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_export_zone_key.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/DNSSEC/,\n    q/export_zone_key/,\n    {\n        'domain' => 'example.com',\n        'key_id' => '12345',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_export_zone_key.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_export_zone_key.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    'DNSSEC',\n    'export_zone_key',\n    array (\n        'domain' => 'example.com',\n        'key_id' => '12345',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 84","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"DNSSEC","description":"The name of the module called."},"result":{"properties":{"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"properties":{"domain":{"example":"example.com","format":"domain","description":"The security key's domain.","type":"string"},"success":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the function succeeded.\n\n* `1` - The function succeeded.\n* `0` - The function failed."},"key_content":{"example":"Private-key-format: v1.2\nAlgorithm: 8 (RSASHA256)\nModulus: 9i8AlGZkwKJj6HYZX+9OcOyCMQ0L9eHBaTg2Y83cVBSaIyiIWo54QpuiJykiuFYYHihOi+LW8vfU9A9jXLBs7DaeDkXO49OqYxfgD1vwmztJeXCQlmgxqUeD181gtSTNO43uUMkCisZft+OsJ96bdUof1UeJ1+IuSENBr1TZgYjmzBgIkmjdv8T5muPaaDfeOISLJKGOG2gI0xlyQ39ppd3CeB90cpIvFpCGjNC8nGvIqN4oyny6NftcEhaRFudbEhB6t2gI362wS5ohERK1F1rBTt+mqUwszCv46Y6p3Za3PsebWK7fR6ITnsW7KGyn3r8BxpJTHlHMwOtBPosaXw==\nPublicExponent: AQAB\nPrivateExponent: MZO5nCkatSh+0jumVImO1HLsrRAhjnzORHBLk8HLUytq9xWckBAM6+0HtLc2BMVhygD4AHfILdn3CsdmjS4CYXeGUP2B8qOXtqkCOFWdmMVRwKEInSGSjrKWPIlhplko84tbqO0yE9xrPk8dRlIwIGizDHKBsfYct/TDb5m4y7rvEHcBSm2DZz7AQL1qqC/WYI54qxHFXTId+nKsYMx/alRUV3AOSL20VSgL56VcM1luFS76ylDIWEOrQVyTFCtEcHvw3FLIOEVCM/CAErLFNlFdXHnYcRYnG/oXcsPW0DjpPNrqx8iaAOuhYFd/pu9CvKQnxYLLqXByOkSUIO3ggQ==\nPrime1: /mtiBD3gJ5Yu5ARsLew4eohRAobl4c3Bt9Gw62wmHiOJfgjbnY91H/bxc/ilnQh92yZUfxfm5z6FXEqluh0ZN3BOQTwzUEuTT9Pn00FhRfemL0UMpHn0BkoXCLwjs1XRyI0hXTOhGhH7XVczuYw/S7kWT5Cmfo4MODZ6cooR8SE=\nPrime2: 97aFfZxJcTYTKkZTc7yeUQVWTtKF25L780TRuCiG83hTSNKlmuWE2bAU/Cl2CX2NdW5sBmO5z9fEI5rA8LhuWHlKF82cXg1h50CsXkaAhFKrThMmb6SRSjIksxlz7rtK777z4En/V9v3l1yKcQ5eSQYQRHg1cCkn6NNlZPZ2G38=\nExponent1: LoHarQPSken2MGBOliZ0PJHmnRujsh82pi+Cs8ZVQXUlkRB1dNvggTNW9+gf/hCrUQA0ufbYkrTvE+vhV6AyF9xDsdEbYDYwe4s0+X0eFvgqPMHWicpxPSUWCNa7f/DUJGEIFE13yZg35twl7GkiuOjglzLN/Jxix3PN9loe5YE=\nExponent2: Mya4iAimzb7p1DfzcZnIY1ijyuEEDSRb7I8Qc2PDAjGdmRMOaV7twPnwS2XQXwNTG6Wyntsm+nlGokeJgevDtXdOSn4FxRIkXllnfow2a5yajSO9Mx6bdePG2kjuPKTmQ3195JnDJYRhqxrL566c351l7I2aE1AcUqKcdG3EU8c=\nCoefficient: T4dFDz5pQhVUQSjV0hhKHHZ1wBxiXdZeCFIfbyypWEdxGXdX2lIN264u9cGQhI+iExTEjZCaYASMBzOqnIhkHhj0M1DGYrhRCdTpgxmDwdcHniRl/XMxPGqpmsP4WFCBxmIbr3SdnqoiPMXix0SjWkHTisq5i09DBMNGIGQyqS8=\n\n","description":"The content of the key, which includes the algorithm.","type":"string"},"key_id":{"minimum":"1","type":"integer","description":"The security key's ID.","example":"12345"},"key_type":{"enum":["CSK","KSK","ZSK"],"example":"KSK","description":"The security key's signing type.\n\n* `CSK` - Combined Signing Key.\n* `KSK` - Key Signing Key.\n* `ZSK` - Zone Signing Key.","type":"string"},"key_tag":{"type":"integer","minimum":"1","example":"51640","description":"The security key's internal identifier."}},"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"type":"string","example":"export_zone_key","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function exports a DNSSEC security key.\n\n**Important:**\n\nWhen you disable the [DNS](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"export_zone_key","parameters":[{"required":"true","name":"domain","in":"query","schema":{"type":"string","example":"example.com","format":"domain"},"description":"The security key's domain."},{"description":"The security key's ID.","schema":{"example":"12345","type":"integer","minimum":"1"},"name":"key_id","in":"query","required":"true"}]}}},"x-tagGroups":[{"tags":["DNS Security"],"name":"DNS"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"unset_nsec3":{"x-tagGroups":[{"name":"DNS","tags":["DNS Security"]}],"paths":{"/DNSSEC/unset_nsec3":{"get":{"parameters":[{"in":"query","name":"domain","required":"true","description":"The domain on which to disable NSEC3 semantics and use NSEC semantics.","schema":{"example":"example.com","type":"string"}}],"operationId":"unset_nsec3","description":"This function configures the domain to use [Next Secure Record](https://tools.ietf.org/html/rfc4470) (NSEC) semantics instead of Next Secure Record 3 (NSEC3) semantics.\n\n**Important:**\n\n  When you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"unset_nsec3","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"disabled":{"description":"A list of the domains for which the system disabled NSEC3.","properties":{"additionalProperties":{"description":"Whether the system disabled NSEC3 on the domain.\n\n* `1` — Disabled.\n* `0` — The system failed to disable NSEC3.\n\n**Note:**\n\nThis return's name is the `domain` parameter's value.","enum":["1","0"],"type":"integer"}},"type":"object"}},"example":{"disabled":{"example.com":"1"}}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"module":{"type":"string","description":"The name of the module called.","example":"DNSSEC"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 60","tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  unset_nsec3 \\\n  domain='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/unset_nsec3?domain=example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_unset_nsec3.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_unset_nsec3.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/DNSSEC/,\n    q/unset_nsec3/,\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_unset_nsec3.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_unset_nsec3.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    'DNSSEC',\n    'unset_nsec3',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Update domain to use NSEC"}}},"tags":[{"name":"DNSSEC","description":"The DNSSEC module for UAPI."},{"name":"DNS Security","description":"DNS / DNS Security"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"openapi":"3.0.2"},"enable_dnssec":{"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"DNSSEC","description":"The DNSSEC module for UAPI."},{"name":"DNS Security","description":"DNS / DNS Security"}],"paths":{"/DNSSEC/enable_dnssec":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  enable_dnssec \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/enable_dnssec?domain=example.com","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_enable_dnssec.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_enable_dnssec.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/DNSSEC/,\n    q/enable_dnssec/,\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_enable_dnssec.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_enable_dnssec.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    'DNSSEC',\n    'enable_dnssec',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["DNSSEC","DNS Security"],"summary":"Enable DNSSEC","x-cpanel-api-version":"UAPI","operationId":"enable_dnssec","description":"This function enables DNSSEC on the domain.\n\n**Note:**\n\n * After you enable DNSSEC on the domain, you **must** add the DNS records to your registrar.\n * You **cannot** modify the DNSSEC security key. To make any changes, you **must** disable (and delete) and re-create the DNSSEC security key.\n\n**Important:**\n\n  When you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"examples":{"multiple":{"summary":"To enable DNSSEC on multiple domains.","value":"domain-0=example0.com&domain-1=example1.com&domain-2=example2.com"},"single":{"value":"example.com","summary":"To enable DNSSEC on a single domain."}},"description":"The domain on which to enable DNSSEC.\n\n**Note:**\n\n To enable DNSSEC on multiple domains, increment the parameter name. For example: `domain-0`, `domain-1`, `domain-2`.","schema":{"format":"domain","type":"string"},"in":"query","name":"domain","required":"true"},{"schema":{"default":"1","example":"1","enum":["0","1"],"type":"integer"},"description":"Whether the domain will use [Next Secure Record](https://tools.ietf.org/html/rfc4470) (NSEC) or NSEC3 semantics.\n\n* `1` — Use NSEC3 semantics.\n* `0` — Use NSEC semantics.\n\n**Note:**\n\n If you use NSEC semantics (`0`), the system ignores the other NSEC3 options.","required":"false","in":"query","name":"use_nsec3"},{"required":"false","name":"nsec3_opt_out","in":"query","schema":{"example":"0","enum":["0","1"],"default":"0","type":"integer"},"description":"Whether the system will create records for all delegations.\n\n* `1` — Create records for all delegations.\n* `0` — Create records only for secure delegations.\n\n**Note:**\n\n **Only** select `1` if you **must** create records for all delegations."},{"description":"The number of times that the system rehashes the first resource record hash operation.\n\nA positive integer less than `501`.\n\n**Note:**\n\nIn cPanel & WHM version 132 and earlier, the default value is `7`.","schema":{"example":"7","default":"0","minimum":"0","maximum":"500","type":"integer"},"in":"query","name":"nsec3_iterations","required":"false"},{"required":"false","in":"query","name":"nsec3_narrow","schema":{"enum":["0","1"],"example":"1","default":"1","type":"integer"},"description":"Whether NSEC3 will operate in Narrow or Inclusive mode.\n\nIn Narrow mode, PowerDNS sends out white lies about the next secure record. Rather than query the resource record in the database, PowerDNS sends the hash plus `1` as the next secure record.\n\n* `1` — Narrow mode.\n* `0` — Inclusive mode."},{"name":"nsec3_salt","in":"query","required":"false","description":"A hexadecimal string that the system appends to the domain name before it applies the hash function to the name. For more information about the salt value, read the [RFC 5155](https://tools.ietf.org/html/rfc5155#section-3.1.5) documentation.\n\n**NOTE:**\n\n* In cPanel & WHM version 132 and later, this parameter also accepts the literal value `-` to indicate that no salt should be used. If you do not declare a value, the system defaults to no salt.\n* In cPanel & WHM version 130 and earlier, if you did not declare a value, the system defaulted to a random 64-bit value.","schema":{"maxLength":"255","type":"string","example":"1A2B3C4D5E6F","format":"hex","default":"-"}},{"description":"The algorithm that the system uses to generate the security key.\n\n* `5` — RSA/SHA-1\n* `6` — DSA-NSEC3-SHA1\n* `7` — RSASHA1-NSEC3-SHA1\n* `8` — RSA/SHA-256\n* `10` — RSA/SHA-512\n* `13` — ECDSA Curve P-256 with SHA-256\n* `14` — ECDSA Curve P-384 with SHA-384\n\n**Note:**\n\n We recommend that you use `ECDSA Curve P-256 with SHA-256` if your registrar supports it.","schema":{"example":"8","default":"8","minimum":"0","maximum":"255","type":"integer"},"in":"query","name":"algo_num","required":"false"},{"schema":{"example":"classic","enum":["simple","classic"],"default":"classic","type":"string"},"description":"The manner in which the system creates the security key.\n\n* `simple` — Use a single key for both KSK and ZSK. Use this value when the `algo_nom` parameter is greater than `8`.\n* `classic` — Use separate keys for KSK and ZSK. Use this value when the `algo_nom` parameter is equal to or less than `8`.","required":"false","in":"query","name":"key_setup"},{"schema":{"enum":["0","1"],"example":"1","default":"1","type":"integer"},"description":"Whether to activate the newly-created key.\n\n* `1` — Activate the key.\n* `0` — Do **not** activate the key.","required":"false","in":"query","name":"active"}],"x-cpanel-available-version":"cPanel 60","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"enable_dnssec","type":"string"},"result":{"properties":{"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"example":{"enabled":{"example.com":{"enabled":"1","new_key_id":"1","nsec_version":"NSEC3"}}},"properties":{"enabled":{"description":"An object containing information about the domains for which the system enabled DNSSEC.","type":"object","properties":{"additionalProperties":{"type":"object","properties":{"enabled":{"type":"integer","enum":["1","0"],"description":"Whether the system enabled DNSSEC.\n\n* `1` — The system enabled DNSSEC.\n* `0` — The system failed to enable DNSSEC."},"nsec_version":{"description":"The version of DNSSEC the system used.\n\n* `NSEC3`\n* `NSEC`","enum":["NSEC3","NSEC"],"type":"string"},"new_key_id":{"type":"integer","description":"The assigned security key ID.","example":"1"}},"description":"Information about the domain for which the system\nenabled DNSSEC.\n\n**Note:**\n\nThis return's name is the `domain` parameter's value."}}}},"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"DNSSEC","description":"The name of the module called."}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["DNS Security"],"name":"DNS"}],"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"export_zone_dnskey":{"paths":{"/DNSSEC/export_zone_dnskey":{"get":{"parameters":[{"description":"The domain from which to fetch the DNSKEY record value.","schema":{"type":"string","example":"example.com","format":"domain"},"name":"domain","in":"query","required":"true"},{"schema":{"example":"12345","minimum":"1","type":"integer"},"description":"The DNSSEC record's ID.","required":"true","name":"key_id","in":"query"}],"description":"This function exports a domain's DNSKEY record value.\n\n**Important:**\n\nWhen you disable the [_DNS_ role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"export_zone_dnskey","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"export_zone_dnskey"},"module":{"type":"string","example":"DNSSEC","description":"The name of the module called."},"result":{"properties":{"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"type":"object","properties":{"key_id":{"minimum":"1","type":"integer","description":"The DNSSEC record's ID.","example":"12345"},"dnskey":{"type":"string","description":"The DNSKEY record value.","example":"AwEAAch8SGW4vE6PjFWA9rbUm0AfTq+gJ0HC/nLu+2axdWHBIStt9lsOzKDorAr4vlmhlJzEzA62s96xp6mZ7XHUyWnkFwLs8obo6upL2in4h1ToOxzVl3lTs8O+kWtDq5/h1nwFlPDs9zpLJhlkTCtx2OTGbvimEYeqwPolUuSQR/Yb"},"success":{"example":"1","enum":["0","1"],"description":"Whether the DNSKEY record exported successfully.\n\n* `1` - The system exported the record successfully.\n* `0` - The system failed to export the record.","type":"integer"}}},"metadata":{"properties":{}},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}}}},"x-cpanel-available-version":"cPanel 88","tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  export_zone_dnskey \\\n  domain='example.com' \\\n  key_id='12345'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/export_zone_dnskey?domain=example.com&key_id=12345"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_export_zone_dnskey.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_export_zone_dnskey.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/DNSSEC/,\n    q/export_zone_dnskey/,\n    {\n        'domain' => 'example.com',\n        'key_id' => '12345',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_export_zone_dnskey.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_export_zone_dnskey.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    'DNSSEC',\n    'export_zone_dnskey',\n    array (\n        'domain' => 'example.com',\n        'key_id' => '12345',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Export DNSKEY record value"}}},"x-tagGroups":[{"name":"DNS","tags":["DNS Security"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"description":"DNS / DNS Security","name":"DNS Security"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"disable_dnssec":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"description":"DNS / DNS Security","name":"DNS Security"}],"paths":{"/DNSSEC/disable_dnssec":{"get":{"tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  disable_dnssec \\\n  domain='example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/disable_dnssec?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_disable_dnssec.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_disable_dnssec.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/DNSSEC/,\n    q/disable_dnssec/,\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_disable_dnssec.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_disable_dnssec.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    'DNSSEC',\n    'disable_dnssec',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Disable DNSSEC","parameters":[{"name":"domain","in":"query","required":"true","examples":{"single":{"value":"example.com","summary":"To enable DNSSEC on a single domain."},"multiple":{"value":"domain-0=example0.com&domain-1=example1.com&domain-2=example2.com","summary":"To enable DNSSEC on multiple domains."}},"description":"The domain on which to disable DNSSEC.\n\n**Note:**\n\n To enable DNSSEC on multiple domains, increment the parameter name. For example: `domain-0`, `domain-1`, `domain-2`.","schema":{"type":"string","format":"domain"}}],"operationId":"disable_dnssec","description":"This function disables DNSSEC on the domain.\n\n**Warning:**\n\n * This action is **irreversible**. If you disable DNSSEC on the domain, you will lose the associated keys. You can only retrieve the previous state with a full backup.\n * If you disable DNSSEC, you **must** remove the DNS records at the registrar.\n\n**Important:**\n\n  When you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"disable_dnssec","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"type":"object","properties":{"disabled":{"description":"An array of objects that contain the domains for which the system disabled DNSSEC.","type":"object","properties":{"additionalProperties":{"type":"integer","description":"Information about the domains for which the system\ndisabled DNSSEC.\n\n* `1` — Disabled.\n* `0` — The system failed to disable DNSSEC.\n\n**Note:**\n\nThis return's name is the `domain` parameter's value.","example":"1","enum":["0","1"]}}}},"example":{"disabled":{"example.com":"1"}}},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}},"type":"object"},"module":{"example":"DNSSEC","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 60"}}},"x-tagGroups":[{"tags":["DNS Security"],"name":"DNS"}]},"remove_zone_key":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"name":"DNS","tags":["DNS Security"]}],"paths":{"/DNSSEC/remove_zone_key":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"remove_zone_key","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"data":{"type":"object","properties":{"error":{"description":"An error message that describes why the system could not remove the security key.\n\n**Note:**\n\nThe function **only** displays this return when the `success` return is a `0` value.","example":"Error: Invalid key_id or domain specified: No such key present for domain.","type":"string"},"success":{"type":"integer","enum":["1","0"],"example":"1","description":"Whether the system removed the security key.\n\n* `1` — The system removed the security key.\n* `0` — The system failed to remove the security key."},"domain":{"type":"string","format":"domain","description":"The domain for which the system removed a security key.","example":"example.com"},"key_id":{"example":"1","description":"The security key's ID.","type":"string"}},"example":{"key_id":"12","success":"1","domain":"example.com"}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"}}},"module":{"type":"string","description":"The name of the module called.","example":"DNSSEC"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 84","parameters":[{"description":"The security key's domain.","schema":{"example":"example.com","format":"domain","type":"string"},"name":"domain","in":"query","required":"true"},{"required":"true","name":"key_id","in":"query","schema":{"minimum":"1","type":"integer","example":"1"},"description":"The security key's ID."}],"description":"This function removes a DNSSEC security key.\n\n**Important:**\n\nWhen you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"remove_zone_key","summary":"Remove DNSSEC security key","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  remove_zone_key \\\n  domain='example.com' \\\n  key_id='1'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/remove_zone_key?domain=example.com&key_id=1","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_remove_zone_key.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_remove_zone_key.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/DNSSEC/,\n    q/remove_zone_key/,\n    {\n        'domain' => 'example.com',\n        'key_id' => '1',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_remove_zone_key.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_remove_zone_key.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    'DNSSEC',\n    'remove_zone_key',\n    array (\n        'domain' => 'example.com',\n        'key_id' => '1',\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}"}],"tags":["DNSSEC","DNS Security"]}}},"tags":[{"name":"DNSSEC","description":"The DNSSEC module for UAPI."},{"name":"DNS Security","description":"DNS / DNS Security"}],"servers":[{"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."}},"description":"A server running cPanel."}]},"deactivate_zone_key":{"paths":{"/DNSSEC/deactivate_zone_key":{"get":{"x-cpanel-available-version":"cPanel 84","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"DNSSEC","description":"The name of the module called.","type":"string"},"result":{"properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"data":{"type":"object","properties":{"key_id":{"example":"1","description":"The security key's ID.","type":"string"},"success":{"description":"Whether the system deactivated the security key.\n\n* `1` - Deactivated.\n* `0` - The system failed to deactivate the security key.","enum":["1","0"],"example":"1","type":"integer"},"domain":{"description":"The domain for which the system deactivated a security key.","format":"domain","example":"example.com","type":"string"},"error":{"description":"An error message that describes why the system could not\ndeactivate the security key.\n\n**Note**\n\nThe function **only** displays this return when the `success` return is a `0` value.","example":"Error:  Invalid key_id or domain specified: No such key present for domain.","type":"string"}}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed. Check the errors field for more details."},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"deactivate_zone_key","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"operationId":"deactivate_zone_key","description":"This function deactivates a DNSSEC security key.\n\n**Important:**\n\nWhen you disable the [*DNS* role](https://go.cpanel.net/serverroles/), the system **disables** this function.","parameters":[{"required":"true","name":"domain","in":"query","schema":{"type":"string","format":"domain","example":"example.com"},"description":"The security key's domain."},{"schema":{"example":"1","type":"integer","minimum":"1"},"description":"The security key's ID.","required":"true","name":"key_id","in":"query"}],"x-cpanel-api-version":"UAPI","summary":"Disable DNSSEC security key","tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  deactivate_zone_key \\\n  domain='example.com' \\\n  key_id='1'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/deactivate_zone_key?domain=example.com&key_id=1","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_deactivate_zone_key.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_deactivate_zone_key.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/DNSSEC/,\n    q/deactivate_zone_key/,\n    {\n        'domain' => 'example.com',\n        'key_id' => '1',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_deactivate_zone_key.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_deactivate_zone_key.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    'DNSSEC',\n    'deactivate_zone_key',\n    array (\n        'domain' => 'example.com',\n        'key_id' => '1',\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}"}]}}},"x-tagGroups":[{"name":"DNS","tags":["DNS Security"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"description":"DNS / DNS Security","name":"DNS Security"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"activate_zone_key":{"paths":{"/DNSSEC/activate_zone_key":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"activate_zone_key","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"DNSSEC","description":"The name of the module called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"example":{"domain":"example.com","success":"1","key_id":"1"},"type":"object","properties":{"error":{"type":"string","example":"Error: Invalid key_id or domain specified: No such key present for domain.","description":"An error message that describes why the system could not activate the security key.\n\n**Note:**\n\nThe function **only** displays this return when the `success` return is a `0` value."},"success":{"example":"1","enum":["1","0"],"description":"Whether the system activated the security key.\n* `1` - Activated.\n* `0` - The system failed to activate the security key. ","type":"integer"},"domain":{"format":"domain","description":"The domain for which the system activated a security key.","example":"example.com","type":"string"},"key_id":{"description":"The security key's ID.","example":"1","type":"string"}}},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 84","parameters":[{"required":"true","in":"query","name":"domain","schema":{"type":"string","example":"example.com","format":"domain"},"description":"The security key's domain."},{"description":"The security key's ID.","schema":{"type":"integer","minimum":"1","example":"1"},"name":"key_id","in":"query","required":"true"}],"description":"This function activates a DNSSEC security key.\n\n**Important:**\n\nWhen you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"activate_zone_key","x-cpanel-api-version":"UAPI","summary":"Enable DNSSEC security key","tags":["DNSSEC","DNS Security"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNSSEC \\\n  activate_zone_key \\\n  domain='example.com' \\\n  key_id='1'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/activate_zone_key?domain=example.com&key_id=1","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNSSEC_activate_zone_key.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNSSEC_activate_zone_key.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/DNSSEC/,\n    q/activate_zone_key/,\n    {\n        'domain' => 'example.com',\n        'key_id' => '1',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNSSEC_activate_zone_key.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNSSEC_activate_zone_key.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    'DNSSEC',\n    'activate_zone_key',\n    array (\n        'domain' => 'example.com',\n        'key_id' => '1',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"x-tagGroups":[{"tags":["DNS Security"],"name":"DNS"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The DNSSEC module for UAPI.","name":"DNSSEC"},{"description":"DNS / DNS Security","name":"DNS Security"}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}},"Market":{"get_product_info":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Market","description":"The Market module for UAPI."},{"name":"Market Integration","description":"Commerce Integration / Market Integration"}],"paths":{"/Market/get_product_info":{"get":{"x-cpanel-api-version":"UAPI","summary":"Retrieve product information","tags":["Market","Market Integration"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_product_info \\\n  product_name='cpanel-ssl'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_product_info?product_name=cpanel-ssl"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_product_info.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_product_info.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/Market/,\n    q/get_product_info/,\n    {\n        'product_name' => 'cpanel-ssl',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_product_info.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_product_info.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    'Market',\n    'get_product_info',\n    array (\n        'product_name' => 'cpanel-ssl',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-available-version":"cPanel 62","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_product_info","description":"The name of the method called.","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"Market"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"properties":{"redirect_url_failure":{"type":"string","example":"https://hostname.example.com:2083/cpsessXXXXXXXXXX/frontend/jupiter/store/purchase_cpanel-ssl_completion.html?domain=example.com&successful_purchase=0","format":"url","description":"The full cPanel URL to redirect to after a failed purchase, including the security token and relevant query string parameters."},"redirect_path":{"description":"The cPanel path to redirect to after a purchase attempt.","example":"/frontend/jupiter/store/purchase_cpanel-ssl_completion.html","type":"string"},"product_id":{"type":"string","example":"123456","description":"The product's identifier in the cPanel Store."},"redirect_url_success":{"type":"string","description":"The full cPanel URL to redirect to after a successful purchase, including the security token and relevant query string parameters.","format":"url","example":"https://hostname.example.com:2083/cpsessXXXXXXXXXX/frontend/jupiter/store/purchase_cpanel-ssl_completion.html?domain=example.com&successful_purchase=1"}},"type":"object"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"}}}}}}},"description":"HTTP Request was successful."}},"operationId":"get_product_info","description":"This function retrieves product information for the specified product name, including the product ID, redirect path, and redirect URLs for successful and failed purchases.","parameters":[{"schema":{"type":"string","example":"cpanel-ssl"},"description":"The name of the product for which to retrieve information.","required":"true","in":"query","name":"product_name"}]}}},"x-tagGroups":[{"name":"Commerce Integration","tags":["Market Integration"]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"get_ssl_certificate_if_available":{"tags":[{"name":"Market","description":"The Market module for UAPI."},{"description":"Commerce Integration / SSL Certificates","name":"SSL Certificates"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["SSL Certificates"],"name":"Commerce Integration"}],"paths":{"/Market/get_ssl_certificate_if_available":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_ssl_certificate_if_available"},"result":{"type":"object","properties":{"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"object","properties":{"status_message":{"description":"An error message from the certificate provider. For example, why a certificate authority rejected an SSL certificate.\n\n**Note:**\n\nIf no error message exists, this will return an empty string.","example":"PRE-SIGN FAILED: CAA: Processing error","type":"string"},"certificate_pem":{"type":"string","description":"The certificate's text.\n* `null` - The certificate is not available.\n* A certificate file in [Base64 PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.","format":"base64 certificate","example":"-----BEGIN CERTIFICATE----- MIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ c2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI DAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy MjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV BAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P Xx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW voK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da M3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC +Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6 PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj UDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw +wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA A4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh cDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw FYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh /SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag qz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa Km6r7YmwfLN/YMZBHXSR58oOGP9W -----END CERTIFICATE-----","nullable":"true"},"encrypted_action_urls":{"properties":{"evClickThroughStatus":{"type":"string","nullable":"true","example":"mgs8RgnN0rkRmJz0SAMvjLokoPoXm5LdzEkmKA7IsGmzvU5XTrFInOegFBbWFycToS7FPOevzkH9\\nZp0+QG1xcC/0bWKB1cNeTiYB3Fmv0HGu2ZsA+AYgIhSsZikyD9M6YbHk1IZA3GLNPl8DxX5zG9LQ\\nHiv7Ll2QMJcPmMaJ3xktTY9NuiaPiPmYBljEE094LeqabP3w/kRALDnhR4FcwjsTn7iDJKoxtKju\\nP/DbgV32vhESwWoaKrIYPkSJ/Dav0a/LQqLqD3Jg27WgrW+GaZSbHlHr09UQW/2CIiIK7jbUoLG3\\nANL0fKevyjxrBjCfXQq0umXcZIJPWo4gfukfkQ==\\n","description":"A URL the user must click to electronically sign an agreement for their Extended Validation (EV) certificate.\n* An encrypted URL.\n* `null` - No action required."},"ovCallbackStatus":{"example":"mgs8RgnN0rkRmJz0SAMvjLokoPoXm5LdzEkmKA7IsGmzvU5XTrFInOegFBbWFycToS7FPOevzkH9\\nZp0+QG1xcC/0bWKB1cNeTiYB3Fmv0HGu2ZsA+AYgIhSsZikyD9M6YbHk1IZA3GLNPl8DxX5zG9LQ\\nHiv7Ll2QMJcPmMaJ3xktTY9NuiaPiPmYBljEE094LeqabP3w/kRALDnhR4FcwjsTn7iDJKoxtKju\\nP/DbgV32vhESwWoaKrIYPkSJ/Dav0a/LQqLqD3Jg27WgrW+GaZSbHlHr09UQW/2CIiIK7jbUoLG3\\nANL0fKevyjxrBjCfXQq0umXcZIJPWo4gfukfkQ==\\n","description":"URL the user must click to verify their identity by phone to complete their Organization Validation (OV) certificate order.\n* An encrypted URL.\n* `null` - No action required.","nullable":"true","type":"string"}},"type":"object","description":"An object that contains encrypted URLs a user must click to complete their SSL certificate order.\n\n**Note:**\n\nThis return may also contain additional key values. For more information, read [Sectigo's documentation](https://sectigo.com/uploads/files/CollectSSL-v1.17.pdf)."},"status_code":{"type":"string","description":"The status code of the certificate.","example":"RequiresApproval"}}},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings\ndescribe non-critical failures or other problematic conditions\nnoted while running a API."},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"Market","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","parameters":[{"in":"query","name":"provider","required":"true","description":"The cPanel Market provider's name.","schema":{"example":"cPStore","type":"string"}},{"description":"The order item for which to poll.","schema":{"example":"8675309","type":"string"},"in":"query","name":"order_item_id","required":"true"}],"description":"This function retrieves SSL certificates when they are available from the cPanel Market provider.","operationId":"get_ssl_certificate_if_available","summary":"Return provider's available SSL certificates","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_ssl_certificate_if_available \\\n  provider='cPStore' \\\n  order_item_id='8675309'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_ssl_certificate_if_available?provider=cPStore&order_item_id=8675309"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_ssl_certificate_if_available.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_ssl_certificate_if_available.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/Market/,\n    q/get_ssl_certificate_if_available/,\n    {\n        'provider' => 'cPStore',\n        'order_item_id' => '8675309',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_ssl_certificate_if_available.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_ssl_certificate_if_available.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    'Market',\n    'get_ssl_certificate_if_available',\n    array (\n        'provider' => 'cPStore',\n        'order_item_id' => '8675309',\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}"}],"tags":["Market","SSL Certificates"]}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"get_provider_specific_dcv_constraints":{"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Market module for UAPI.","name":"Market"},{"name":"SSL Certificates","description":"Commerce Integration / SSL Certificates"}],"paths":{"/Market/get_provider_specific_dcv_constraints":{"get":{"description":"This function returns the provider's filename requirements for Domain Control Validation (DCV) checks.","operationId":"Market-get_provider_specific_dcv_constraints","parameters":[{"schema":{"example":"cPStore","type":"string"},"description":"The cPanel Market provider's name.","required":"true","in":"query","name":"provider"}],"x-cpanel-available-version":"cPanel 62","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"get_provider_specific_dcv_constraints","description":"The name of the method called.","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"Market"},"result":{"type":"object","properties":{"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"data":{"properties":{"dcv_max_redirects":{"minimum":"0","type":"integer","example":"0","description":"The maximum number of HTTP redirects the provider allows."},"dcv_file_random_character_count":{"minimum":"1","type":"integer","example":"32","description":"The number of characters that the provider allows in the DCV check file's filename."},"dcv_file_relative_path":{"format":"path","description":"The path to the DCV check file, relative to the domain's document root directory.","example":".well-known/pki-validation","type":"string"},"dcv_file_allowed_characters":{"type":"array","items":{"example":["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],"type":"array"},"description":"An array that lists the characters which the provider allows in the DCV check file's filename."},"dcv_file_extension":{"type":"string","example":"txt","description":"The DCV check file extension that the provider requires."},"dcv_user_agent_string":{"type":"string","example":"COMODO DCV","description":"The user agent string that the system will use for the imitated local DCV check."}},"type":"object"},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["Market","SSL Certificates"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_provider_specific_dcv_constraints \\\n  provider='cPStore'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_provider_specific_dcv_constraints?provider=cPStore"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_provider_specific_dcv_constraints.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_provider_specific_dcv_constraints.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/Market/,\n    q/get_provider_specific_dcv_constraints/,\n    {\n        'provider' => 'cPStore',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_provider_specific_dcv_constraints.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_provider_specific_dcv_constraints.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    'Market',\n    'get_provider_specific_dcv_constraints',\n    array (\n        'provider' => 'cPStore',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Return provider's DCV filename requirements"}}},"x-tagGroups":[{"tags":["SSL Certificates"],"name":"Commerce Integration"}],"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"set_status_of_pending_queue_items":{"x-tagGroups":[{"tags":["Market Integration"],"name":"Commerce Integration"}],"paths":{"/Market/set_status_of_pending_queue_items":{"get":{"summary":"Update status of items in pending queue","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  set_status_of_pending_queue_items \\\n  provider='cPStore' \\\n  order_item_id='12345' \\\n  status='confirmed'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/set_status_of_pending_queue_items?provider=cPStore&order_item_id=12345&status=confirmed","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_set_status_of_pending_queue_items.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_set_status_of_pending_queue_items.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/Market/,\n    q/set_status_of_pending_queue_items/,\n    {\n        'provider' => 'cPStore',\n        'order_item_id' => '12345',\n        'status' => 'confirmed',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_set_status_of_pending_queue_items.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_set_status_of_pending_queue_items.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    'Market',\n    'set_status_of_pending_queue_items',\n    array (\n        'provider' => 'cPStore',\n        'order_item_id' => '12345',\n        'status' => 'confirmed',\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}"}],"tags":["Market","Market Integration"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"set_status_of_pending_queue_items","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"Market","description":"The name of the module called."},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"description":"The function only returns these values if the user or users do **not** have the `order_item_id` item in the cPanel Market pending queue.","nullable":"true","properties":{"order_item_ids":{"description":"An array that lists order item IDs which do not exist in the cPanel Market pending queue for the user.","items":{"type":"integer","minimum":"0","example":"8675309"},"type":"array"},"error_type":{"type":"string","description":"The type of error that the function encountered.\n\n* `EntryDoesNotExist` — The returned `order_item_ids` do not exist in the cPanel Market pending queue for the user.","example":"EntryDoesNotExist","enum":["EntryDoesNotExist"]}},"type":"object"}}}},"type":"object"},"examples":{"success":{"value":{"func":"set_status_of_pending_queue_items","result":{"metadata":{},"status":"1","errors":null,"data":null,"warnings":null,"messages":null},"apiversion":"3","module":"Market"},"summary":"The function succeeded."},"failure":{"summary":"The function failed.","value":{"module":"Market","apiversion":"3","result":{"messages":null,"warnings":null,"data":{"error_type":"EntryDoesNotExist","order_item_ids":["8675309"]},"status":"0","errors":["The order item ID “8675309” does not match any entries in the pending queue."],"metadata":{}},"func":"set_status_of_pending_queue_items"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","parameters":[{"schema":{"type":"string","example":"cPStore"},"description":"The cPanel Market provider's name.","required":"true","in":"query","name":"provider"},{"name":"order_item_id","in":"query","required":"true","description":"The ID of the ordered item.\n\n**Note:**\n\nTo set the status for multiple items, duplicate or increment the parameter name. For example, to change the status for three certificates, use the `order_item_id` parameter multiple times or use the `order_item_id-1`, `order_item_id-2`, and `order_item_id-3` parameters.","examples":{"single":{"value":"12345","summary":"A single ID."},"multiple":{"summary":"Multiple IDs.","value":"order_item_id-1=12345&order_item_id-2=12346&order_item_id-3=12347"},"multiple-alternative":{"value":"order_item_id=12345&order_item_id=12346&order_item_id=12347","summary":"Multiple IDs alternative."}},"schema":{"type":"string"}},{"required":"true","in":"query","name":"status","schema":{"type":"string","enum":["confirmed"],"example":"confirmed"},"description":"The new status of the item in the cPanel Market pending queue.\n\n* `confirmed` — The system confirmed payment for the item with the provider."}],"operationId":"set_status_of_pending_queue_items","description":"This function sets the status of an item or items in the cPanel Market pending queue."}}},"tags":[{"description":"The Market module for UAPI.","name":"Market"},{"name":"Market Integration","description":"Commerce Integration / Market Integration"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"validate_login_token":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"x-tagGroups":[{"tags":["Market Integration"],"name":"Commerce Integration"}],"paths":{"/Market/validate_login_token":{"get":{"summary":"Validate login token","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  validate_login_token \\\n  provider='cPStore' \\\n  login_token='8675309' \\\n  url_after_login='http://hostname.example.com/redirectionlocation.cgi?state'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/validate_login_token?provider=cPStore&login_token=8675309&url_after_login=http%3a%2f%2fhostname.example.com%2fredirectionlocation.cgi%3fstate","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_validate_login_token.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_validate_login_token.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/Market/,\n    q/validate_login_token/,\n    {\n        'provider' => 'cPStore',\n        'login_token' => '8675309',\n        'url_after_login' => 'http://hostname.example.com/redirectionlocation.cgi?state',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_validate_login_token.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_validate_login_token.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    'Market',\n    'validate_login_token',\n    array (\n        'provider' => 'cPStore',\n        'login_token' => '8675309',\n        'url_after_login' => 'http://hostname.example.com/redirectionlocation.cgi?state',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Market","Market Integration"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"data":{"properties":{"access_token":{"type":"string","description":"The access token that returns from the code parameter after you log in.","example":"8675309"}},"type":"object"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"description":"* `1` Success.\n* `0` Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"Market","description":"The name of the module called."},"func":{"example":"validate_login_token","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","parameters":[{"schema":{"example":"cPStore","type":"string"},"description":"The name of the cPanel Market provider.","required":"true","in":"query","name":"provider"},{"in":"query","name":"login_token","required":"true","description":"The login token for the cPanel Market provider.","schema":{"example":"8675309","type":"string"}},{"description":"The `url_after_login` value that you sent to UAPI's `Market::get_login_url` function.","schema":{"type":"string","example":"http://hostname.example.com/redirectionlocation.cgi?state","format":"url"},"in":"query","name":"url_after_login","required":"true"}],"operationId":"validate_login_token","description":"This function validates a login token to a cPanel Market provider and returns an access token."}}},"tags":[{"name":"Market","description":"The Market module for UAPI."},{"description":"Commerce Integration / Market Integration","name":"Market Integration"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"cancel_pending_ssl_certificate":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/Market/cancel_pending_ssl_certificate":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"Market","description":"The name of the module called."},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings\ndescribe non-critical failures or other problematic conditions\nnoted while running an API.","example":null},"data":{"items":{"properties":{"first_poll_time":{"type":"integer","format":"unix_timestamp","description":"The first time that the system polled the provider for the certificate.","example":"1458061262"},"product_id":{"description":"The product's ID.","example":"143","type":"string"},"created_time":{"type":"integer","example":"1458061262","description":"When the system created the order.","format":"unix_timestamp"},"order_item_id":{"type":"string","example":"10427508","description":"The ID of the ordered item."},"domains":{"type":"array","example":["example1.com","example2.com"],"description":"A list of domains on the certificate.","items":{"type":"string","format":"domain"}},"csr":{"description":"The text of the Certificate Request (CSR).","format":"base64 certificate","example":"-----BEGIN CERTIFICATE REQUEST-----\nMIIC0TCCAbkCAQAwGzEZMBcGA1UEAxMQY29icmFzc2x0ZXN0Lm9yZzCCASIwDQYJ\nKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKsZWNkF8hjUjoCDNNSkXO0CTp/z/0pu\niFiDMzdFAa6mg5wr97EwRBCniSvJEJ1rdQ0Sus2AAK9hg7TeZAWbFf97r7mS0chm\nr27Ht9qfit3r0EJLYcjRjnZ/wj21ZhsdjQIjjTRiI1TvXtOQRAQpWNsGxK7QV3Q3\nnjkSM/gTpteHuC3JAQxbpv72B+IjiyzUZr8DOUOoB94IO5iP27UXnkSbExInDvqu\nK43zVGYNU0Zev20A6SBWU3BALjWXHlYjwbC109FxOWNssHTg3xvePsBxzk6BFDcT\nS/QAS0tFYPfHZKmCBg6irBGFOdTjSDVmFk8zAoFYibev0juRJCMn2XsCAwEAAaBx\nMG8GCSqGSIb3DQEJDjFiMGAwXgYDVR0RAQH/BFQwUoIQY29icmFzc2x0ZXN0Lm9y\nZ4IUd3d3LmNvYnJhc3NsdGVzdC5vcmeCEWNwYW5lbHNzbHRlc3Qub3JnghV3d3cu\nY3BhbmVsc3NsdGVzdC5vcmcwDQYJKoZIhvcNAQELBQADggEBAG0l4aChMO1rSmgR\nSF5qlKu785n5YS5rTE9ev+OFu0952DvjVAB0R8y5+TZSXfg+9CH7pa2VDosAEYF4\nyjUJOuiwwVEUD/9Qhrls/2xT8KKk0QSxuWmOgP2YQy/QRH+W7ykoigtiWdXEIUuF\niJmeavS8JOYt560366V3dw7YT+QstUHQ7UlGEFDeWQI3osUN1wDrtW5qcaq09Q/G\nTcphzXrRkL5lRjKXKLIcY/HVYzOnoEX30ALX2I3bJ9s4IMRfpnhTqLmWalcr+4vq\nvqVnlB0B/nXf/qaB/xvxmEtSGx/GZ/8Gsrf5PB7GhRuStUtJoXcLuADK0bgug3X2\nGxEruS4=\n-----END CERTIFICATE REQUEST-----\n","type":"string"},"vhost_names":{"type":"array","description":"A list of virtual host names.","items":{"type":"string"},"example":["abcde.com"]},"order_id":{"example":"1392472","description":"The ID of the order.","type":"string"},"status":{"type":"string","description":"The status of the order.\n* `confirmed` - Payment confirmed.\n* `unconfirmed` - Payment **not** confirmed.","enum":["confirmed","unconfirmed"],"example":"confirmed"},"provider":{"type":"string","description":"The cPanel Market provider's name.","example":"cPStore"},"last_poll_time":{"format":"unix_timestamp","description":"The last time that the system polled the\nprovider for the certificate. ","example":"1458061262","type":"integer"},"support_uri":{"type":"string","format":"uri","description":"The URI of the cPanel Market Provider's support site.","example":"http://support.example.com/"},"expired":{"description":"Whether the system has deleted the item from the pending queue.\n* `1` - Deleted.\n* `0` - **Not** deleted.","enum":["0","1"],"example":"0","type":"integer"},"last_status_code":{"description":"The last status code of the order.\n* `CertificateNotFound` - The system cannot locate the specified certificate.\n* `RequiresApproval` - The specified certificate requires approval.\n* `OrderCanceled` - The system cancelled the order of the specified certificate.\n* `OrderItemCanceled` - The system cancelled the order item of the specified certificate.","example":"CertificateNotFound","enum":["CertificateNotFound","RequiresApproval","OrderCanceled","OrderItemCanceled"],"type":"string"}},"type":"object"},"description":"An object containing order information.","type":"array"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}}}},"func":{"type":"string","description":"The name of the method called.","example":"cancel_pending_ssl_certificate"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","parameters":[{"in":"query","name":"provider","required":"true","description":"The cPanel Market provider's name.","schema":{"type":"string","example":"cPStore"}},{"in":"query","name":"order_item_id","required":"true","description":"The ID of the ordered item to cancel.","schema":{"example":"10427508","type":"string"}}],"description":"This function cancels an order and removes the polling for a pending certificate.","operationId":"cancel_pending_ssl_certificate","x-cpanel-api-version":"UAPI","summary":"Delete an order","tags":["Market","SSL Certificates"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  cancel_pending_ssl_certificate \\\n  provider='cPStore' \\\n  order_item_id='10427508'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Market/cancel_pending_ssl_certificate?provider=cPStore&order_item_id=10427508"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_cancel_pending_ssl_certificate.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_cancel_pending_ssl_certificate.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/Market/,\n    q/cancel_pending_ssl_certificate/,\n    {\n        'provider' => 'cPStore',\n        'order_item_id' => '10427508',\n    }\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_cancel_pending_ssl_certificate.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_cancel_pending_ssl_certificate.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    'Market',\n    'cancel_pending_ssl_certificate',\n    array (\n        'provider' => 'cPStore',\n        'order_item_id' => '10427508',\n    )\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-tagGroups":[{"tags":["SSL Certificates"],"name":"Commerce Integration"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Market","description":"The Market module for UAPI."},{"name":"SSL Certificates","description":"Commerce Integration / SSL Certificates"}]},"get_license_info":{"paths":{"/Market/get_license_info":{"get":{"description":"This function retrieves license information for the specified domain from the cPanel Store and saves it to the current session.","operationId":"get_license_info","parameters":[{"schema":{"type":"string","example":"example.com"},"description":"The domain for which to retrieve license information. This parameter is optional.","required":"false","in":"query","name":"domain"}],"x-cpanel-available-version":"cPanel 62","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"Market","description":"The name of the module called."},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","example":null,"description":"This function does not return data."},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}}},"func":{"description":"The name of the method called.","example":"get_license_info","type":"string"}}}}}}},"tags":["Market","Market Integration"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_license_info \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_license_info?domain=example.com","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_license_info.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_license_info.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/Market/,\n    q/get_license_info/,\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_license_info.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_license_info.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    'Market',\n    'get_license_info',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Retrieve license information for a domain"}}},"x-tagGroups":[{"name":"Commerce Integration","tags":["Market Integration"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"Market","description":"The Market module for UAPI."},{"description":"Commerce Integration / Market Integration","name":"Market Integration"}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"create_shopping_cart_non_ssl":{"tags":[{"description":"The Market module for UAPI.","name":"Market"},{"name":"Market Integration","description":"Commerce Integration / Market Integration"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Commerce Integration","tags":["Market Integration"]}],"paths":{"/Market/create_shopping_cart_non_ssl":{"get":{"summary":"Create shopping cart for non-SSL products","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  create_shopping_cart_non_ssl \\\n  access_token='1a676e6f-99fc-11e6-9ab6-e60a769b73bc' \\\n  product_name='cpanel-ssl' \\\n  url_after_checkout='http://www.example.com/thenextplace'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Market/create_shopping_cart_non_ssl?access_token=1a676e6f-99fc-11e6-9ab6-e60a769b73bc&product_name=cpanel-ssl&url_after_checkout=http%3a%2f%2fwww.example.com%2fthenextplace"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_create_shopping_cart_non_ssl.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_create_shopping_cart_non_ssl.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/Market/,\n    q/create_shopping_cart_non_ssl/,\n    {\n        'access_token'      => '1a676e6f-99fc-11e6-9ab6-e60a769b73bc',\n        'product_name'      => 'cpanel-ssl',\n        'url_after_checkout' => 'http://www.example.com/thenextplace',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_create_shopping_cart_non_ssl.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_create_shopping_cart_non_ssl.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    'Market',\n    'create_shopping_cart_non_ssl',\n    array (\n        'access_token'       => '1a676e6f-99fc-11e6-9ab6-e60a769b73bc',\n        'product_name'       => 'cpanel-ssl',\n        'url_after_checkout' => 'http://www.example.com/thenextplace',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Market","Market Integration"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"create_shopping_cart_non_ssl"},"module":{"type":"string","example":"Market","description":"The name of the module called."},"result":{"type":"object","properties":{"status":{"example":"1","enum":["0","1"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"properties":{"order_id":{"description":"The order ID assigned by the provider.","example":"8765309","type":"string"},"checkout_url":{"example":"https://store.cpanel.net/checkout?order_id=8765309","format":"url","description":"The URL of the provider's checkout page.","type":"string"},"order_items_ref":{"description":"An array of objects that contain information about the items in the shopping cart. The values returned vary between providers.","items":{"type":"object"},"type":"array"}},"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 62","parameters":[{"schema":{"format":"uuid","example":"1a676e6f-99fc-11e6-9ab6-e60a769b73bc","type":"string"},"description":"The access token obtained during login to the cPanel Market provider.","required":"true","in":"query","name":"access_token"},{"name":"product_name","in":"query","required":"true","description":"The name of the product to purchase.","schema":{"type":"string","example":"cpanel-ssl"}},{"required":"false","name":"domain","in":"query","schema":{"type":"string","example":"example.com"},"description":"The domain associated with the product purchase. This parameter is optional."},{"description":"The URL to which the provider redirects the user after the checkout process is complete.","schema":{"format":"url","example":"http://www.example.com/thenextplace","type":"string"},"name":"url_after_checkout","in":"query","required":"true"}],"operationId":"create_shopping_cart_non_ssl","description":"This function creates a shopping cart for non-SSL products. It validates the access token, retrieves product information, creates a shopping cart with the provider, and returns the order details and checkout URL."}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"get_providers_list":{"paths":{"/Market/get_providers_list":{"get":{"x-cpanel-available-version":"cPanel 56","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"get_providers_list","description":"The name of the method called."},"module":{"description":"The name of the module called.","example":"Market","type":"string"},"result":{"properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"data":{"type":"array","description":"An array of objects that lists enabled providers in the cPanel Market.","items":{"type":"object","properties":{"display_name":{"description":"The cPanel Market provider's display name.","example":"cPanel Store","type":"string"},"name":{"type":"string","example":"cPStore","description":"The cPanel Market provider's name."}}}},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}}}},"operationId":"Market-get_providers_list","description":"This function lists the names of enabled cPanel Market providers.","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return enabled providers","tags":["Market","Market Integration"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_providers_list\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_providers_list"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_providers_list.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_providers_list.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/Market/,\n    q/get_providers_list/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_providers_list.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_providers_list.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    'Market',\n    'get_providers_list'\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-tagGroups":[{"tags":["Market Integration"],"name":"Commerce Integration"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Market","description":"The Market module for UAPI."},{"name":"Market Integration","description":"Commerce Integration / Market Integration"}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"request_ssl_certificates":{"x-tagGroups":[{"name":"Commerce Integration","tags":["SSL Certificates"]}],"paths":{"/Market/request_ssl_certificates":{"get":{"x-cpanel-available-version":"cPanel 56","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"request_ssl_certificates"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings\ndescribe non-critical failures or other problematic conditions\nnoted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"properties":{"certificates":{"description":"Information about each certificate in the order.","type":"object","properties":{"key_id":{"type":"string","description":"The private key's ID.","example":"ac90f_639fd_6c236062f0d7a4579a30e01612c4cee0"},"order_item_id":{"type":"integer","minimum":"1","description":"The ID of the ordered item.","example":"12345"}}},"checkout_url":{"type":"string","example":"http://store.example.com/showmethemoney.cgi","format":"url","description":"The URL that the cPanel Market provider uses to process payment."},"order_id":{"minimum":"1","type":"integer","description":"The order ID that the cPanel Market provider assigned.","example":"123456"}},"type":"object"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Market"}}}}},"description":"HTTP Request was successful."}},"description":"This function submits a request for a certificate order to the cPanel Market provider.","operationId":"request_ssl_certificates","parameters":[{"required":"true","in":"query","name":"access_token","schema":{"example":"725431a1-d5bc-11e5-a28b-8b0e09a93f05","type":"string"},"description":"The access token for the session to the cPanel Market provider."},{"required":"true","in":"query","name":"certificate","content":{"application/json":{"schema":{"required":["product_id","price","subject_names","validity_period"],"properties":{"subject_names":{"anyOf":[{"type":"array","description":"HTTP-based DCV only.","items":{"type":"string"}},{"description":"DNS-based DCV or HTTP-based DCV.","items":{"type":"object"},"type":"array"}],"description":"An array of strings or array of objects containing the certificate's subject names:\n\n**For HTTP-based DCV only:**\n\nUse an array of strings that contains `dNSName` and the domain.\n\nFor example:\n\n`[[\"dNSName\",\"example.com\"],[\"dNSName\",\"example.org\"]]`\n\n**DNS-based DCV or HTTP-based DCV:**\n\nUse an array of objects that consits of:\n\n* `type:dNSName`\n* `name` — The domain name.\n* `dcv_method` — Either the `dns` or `http` value for for DNS-based or HTTP-based Domain Control Validation (DCV).\n\nFor example:\n\n`[{type:“dNSName”,name:“text.example.com”,dcv_method:“dns”},{type:“dNSName”,name:“text.example.com”,dcv_method:“http”}]`\n\n**Note:**\n\n* Custom provider modules that include DNS-based DCV requests **must** use the array of\nobjects format, **not** the array of strings format.\n* This function does **not** automatically include the corresponding `www.` subdomain for each domain\nthat you declare in this parameter.\n* If you wish to order the `www.` subdomain for a domain, you **must** explicitly declare it in an additional\narray or object within the `subject_names` parameter."},"product_id":{"description":"The product's ID.","type":"string"},"validity_period":{"description":"The period of time the certificate will remain valid.\nThis array consists of a number value and string that represents a unit of time (for example, `year`).","items":{"type":"string"},"type":"array"},"vhost_names":{"items":{"type":"string"},"description":"A comma-separated list of web virtual hosts (vhosts) for which the system will install the certificate.\n\n**Note:**\n\nAn asterisk (`*`) chraracter represents every vhost with which the certificate is compatible.","type":"array"},"price":{"format":"currency","description":"The certificate's price.","type":"number"}},"example":{"vhost_names":["example.com"],"price":"6","validity_period":["1, \"year\""],"product_id":"143","subject_names":[{"dNSName":"example.com"},{"dNSName":"example.org"}]}}}},"description":"A JSON-encoded string that contains the details of the certificate.\n\n**Note:**\n\nTo request multiple certificates, duplicate or increment the parameter name.\nFor example, to request three certificates, use the `certificate` parameter multiple times or use the `certificate-1`,\n`certificate-2`, and `certificate-3` parameters."},{"required":"true","name":"provider","in":"query","schema":{"type":"string","example":"cPStore"},"description":"The cPanel Market provider's name."},{"schema":{"type":"string","format":"url","example":"http://checkout.example.com"},"description":"The URL to send the browser after the user checks out.\n\n**Note:**\n\nThis URL does **not** contain a query string.","required":"false","name":"url_after_checkout","in":"query"},{"description":"An object containing the required information for an EV or OV certificate. This information depends on the provider of the certificate.\n\n**Note:**\n\nThe function returns this object for OV or EV certificate requests.","content":{"application/json":{"schema":{"example":{"countryName":"US","duns_number":"12-345-6789","streetAddress":"555 Street Name","organizationalUnitName":"Team Company,","stateOrProvinceName":"ST","rep_email_address":"username@example.com","postalCode":"55555","rep_surname":"Last Name","organizationName":"Company, Inc.","localityName":"City Name","rep_telephone":"123-456-7891","rep_forename":"First Name"},"type":"object"}}},"in":"query","name":"identity_verification","required":"false"}],"x-cpanel-api-version":"UAPI","summary":"Request SSL certificate order","tags":["Market","SSL Certificates"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output-jsonpretty --user=username Market request_ssl_certificates access_token='725431a1-d5bc-11e5-a28b-8b0e09a93f05' certificate='{\"price\":\"6\",\"product_id\":\"143\",\"subject_names\":[{\"dNSName\":\"example.com\"},{\"dNSName\":\"example.org\"}],\"validity_period\":[\"1, \\\"year\\\"\"],\"vhost_names\":[\"example.com\"]}' provider='cPStore'"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/request_ssl_certificates?access_token=725431a1-d5bc-11e5-a28b-8b0e09a93f05&certificate=%7b%22price%22%3a%226%22%2c%22product_id%22%3a%22143%22%2c%22subject_names%22%3a%5b%7b%22dNSName%22%3a%22example.com%22%7d%2c%7b%22dNSName%22%3a%22example.org%22%7d%5d%2c%22validity_period%22%3a%5b%221%2c%20%5c%22year%5c%22%22%5d%2c%22vhost_names%22%3a%5b%22example.com%22%5d%7d&provider=cPStore","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_request_ssl_certificates.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_request_ssl_certificates.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/Market/,\n    q/request_ssl_certificates/,\n    {\n        'access_token' => '725431a1-d5bc-11e5-a28b-8b0e09a93f05',\n        'certificate' => '{\"price\":\"6\",\"product_id\":\"143\",\"subject_names\":[{\"dNSName\":\"example.com\"},{\"dNSName\":\"example.org\"}],\"validity_period\":[\"1, \\\"year\\\"\"],\"vhost_names\":[\"example.com\"]}',\n        'provider' => 'cPStore',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_request_ssl_certificates.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_request_ssl_certificates.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    'Market',\n    'request_ssl_certificates',\n    array (\n        'access_token' => '725431a1-d5bc-11e5-a28b-8b0e09a93f05',\n        'certificate' => '{\"price\":\"6\",\"product_id\":\"143\",\"subject_names\":[{\"dNSName\":\"example.com\"},{\"dNSName\":\"example.org\"}],\"validity_period\":[\"1, \\\"year\\\"\"],\"vhost_names\":[\"example.com\"]}',\n        'provider' => 'cPStore',\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}"}]}}},"tags":[{"name":"Market","description":"The Market module for UAPI."},{"name":"SSL Certificates","description":"Commerce Integration / SSL Certificates"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"get_completion_url":{"x-tagGroups":[{"name":"Commerce Integration","tags":["Market Integration"]}],"paths":{"/Market/get_completion_url":{"get":{"summary":"Get product purchase completion URL","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_completion_url \\\n  product_name='cpanel-ssl'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_completion_url?product_name=cpanel-ssl","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_completion_url.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_completion_url.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/Market/,\n    q/get_completion_url/,\n    {\n        'product_name' => 'cpanel-ssl',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_completion_url.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_completion_url.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    'Market',\n    'get_completion_url',\n    array (\n        'product_name' => 'cpanel-ssl',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Market","Market Integration"],"x-cpanel-available-version":"cPanel 62","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Market"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"data":{"type":"object","properties":{"completion_url":{"example":"https://hostname.example.com:2083/cpsessXXXXXXXXXX/frontend/jupiter/store/purchase_cpanel-ssl_completion.html","format":"url","description":"The full cPanel URL for the product purchase completion page, including the security token.","type":"string"}}},"metadata":{"properties":{}}}},"func":{"description":"The name of the method called.","example":"get_completion_url","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"get_completion_url","description":"This function builds the full cPanel URL for the product purchase completion page. The URL includes the security token and points to the completion page for the specified product.","parameters":[{"schema":{"example":"cpanel-ssl","type":"string"},"description":"The name of the product for which to retrieve the completion URL.","required":"true","in":"query","name":"product_name"}]}}},"tags":[{"description":"The Market module for UAPI.","name":"Market"},{"name":"Market Integration","description":"Commerce Integration / Market Integration"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"get_pending_ssl_certificates":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"x-tagGroups":[{"tags":["SSL Certificates"],"name":"Commerce Integration"}],"paths":{"/Market/get_pending_ssl_certificates":{"get":{"x-cpanel-available-version":"cPanel 56","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_pending_ssl_certificates","type":"string"},"module":{"example":"Market","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"description":"An array of objects that contain information about each certificate for which the system polls the provider.","items":{"properties":{"domains":{"type":"array","items":{"type":"string","format":"domain","example":"example.com"},"description":"The domains on the certificate."},"order_item_id":{"type":"string","description":"The ID of the ordered item.","example":"1"},"identity_verification":{"example":{"joi_country_name":"US","rep_telephone":"713-529-0800","rep_surname":"Ang","joi_state_or_province_name":"PA","postalCode":"77092","duns_number":"12-345-6789","joi_locality_name":"Somewhere","business_category":"b","date_of_incorporation":"1996-01-01","streetAddress":"2500 N. Loop W.","assumed_name":"cPanel","rep_email_address":"richard.ang@cpanel.net","stateOrProvinceName":"TX","rep_forename":"Richard","localityName":"Houston","organizationName":"WebPros International, LLC","countryName":"US","organizationalUnitName":"Team Cobra"},"description":"hash that contains information to verify an OV or EV certificate request.\n\n**Notes:**\n\n The function returns this hash for OV or EV certificate requests. This hash includes returns that vary between certificate providers. The output example demonstrates what the cPStore returns for an OV certificate.","type":"object"},"created_time":{"example":"1417475501","description":"When the system placed the order.","format":"unix_timestamp","type":"integer"},"first_poll_time":{"description":"The first time that the system polled the provider for the certificate.","format":"unix_timestamp","example":"1437475501","type":"integer"},"product_id":{"description":"The product's ID.","example":"12345","type":"string"},"provider":{"type":"string","example":"cPStore","description":"The cPanel Market provider's name."},"order_id":{"description":"The ID of the order.","example":"AAE35B28-E57B-11E5-A5DD-B633DD41FB49","type":"string"},"vhost_names":{"type":"array","description":"The virtual host domains on the certificate.","items":{"type":"string","format":"domain","example":"example.com"}},"status":{"description":"The status of the order.\n* `confirmed` - Payment confirmed.\n* `unconfirmed` - Payment not confirmed.","example":"confirmed","type":"string"},"csr":{"type":"string","description":"The certificate signing request's (CSR) text. A CSR file in Base64 PEM format.","format":"base64 certificate","example":"Click to view...-----BEGIN CERTIFICATE REQUEST----- MIIC4DCCAcgCAQAwgZoxFjAUBgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsT DURvY3VtZW50YXRpb24xDjAMBgNVBAgTBVRleGFzMQ8wDQYDVQQKEwZjUGFuZWwx KDAmBgkqhkiG9w0BCQEWGWxhdXJlbmNlLnNpbW9uQGNwYW5lbC5uZXQxCzAJBgNV BAYTAlVTMRAwDgYDVQQHEwdIb3VzdG9uMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEA4AVM6J4Qg3DIFWr/eJ5GRmIATYsJIepKbrDy70sq+udcO8R8xxak 0oMZ/9mUdpjSNK/fLVTuCO0kxTfQ9VUWJllX7ThD6Zh9ZvlC/nf/OEZLm3ZbnBgu 8rbC8E9wuDOkKbJLnINgdhtowIydLK2MJ++q62bFV89jkHWTMcKyyqHENo3hc+lk pd9vnp8rZTinaVb7nX26uQqAFZYRo+WU0G/NPsq40QVSMoqPxyEz4qXo0hvuIlCX mzFZq/6fCVPEKPLhQgMmpdBkMz4dVOazREfqXdjMD2+QXSNiA1AwWr8l0r4rtzlx EYDJIR41yXp0xMl3KoolxMyvLBqZy32niQIDAQABoAAwDQYJKoZIhvcNAQEFBQAD ggEBAEaCn+rg6qlhp6SEKuZg1G6z1M+1XQoTN3E6bTdM3rD1wXjqtyFfYGTy5Bvv gUKrl6t312owJ2si8/K9v/ocVxdjc0rPWSOWScfSc1Od3i1L1YuqbboL2aQSak3y gpGnZMHCUED1y4xyABAFOaXUurFiZj5u3P2mBAYGt2ez2afiPlo5YpTRNCoTUlVz KNKkyUnptBLOvlwGgerBmOoP4QdVhTSuxO9TECsiPdldE1BVZrlFclDFvoP01jFZ WOTWz+k3O202gK4w/tPP2VMVldNFrC0QoENu85ohT1nJj6F3mrM1CZ+1c8zYzr+S 6aAXFhHE6FweeunRAGjEJggoTPo= -----END CERTIFICATE REQUEST-----"},"expired":{"type":"integer","description":"Whether the pending queue item has been deleted.\n* `1` - Deleted.\n* `0` - **Not** deleted.","example":"0","enum":["0","1"]},"support_uri":{"type":"string","example":"http://support.example.com/","description":"The URI of the cPanel Market Provider's support site.","format":"url"},"last_poll_time":{"description":"The last time that the system polled the provider for the certificate.","format":"unix_timestamp","example":"1457475501","type":"integer"},"last_status_code":{"type":"string","enum":["CertificateNotFound","RequiresApproval","OrderCanceled","OrderItemCanceled"],"example":"CertificateNotFound","description":"The last status code of the order. The function returns the value in the unnamed hash.\n* `CertificateNotFound` - The system cannot locate the specified certificate.\n* `RequiresApproval` - The specified certificate requires approval.\n* `OrderCanceled` - The system canceled the order of the specified certificate.\n* `OrderItemCanceled` - The system canceled the order item of the specified certificate."}},"type":"object"},"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}},"type":"object"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"get_pending_ssl_certificates","description":"This function lists all pending SSL certificates from a cPanel Market provider for which the system currently polls.","parameters":[{"name":"provider","in":"query","required":"true","description":"The cPanel Market provider's name.","schema":{"type":"string","example":"cPStore"}}],"x-cpanel-api-version":"UAPI","summary":"Return provider's pending SSL certificates","tags":["Market","SSL Certificates"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_pending_ssl_certificates \\\n  provider='cPStore'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_pending_ssl_certificates?provider=cPStore","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_pending_ssl_certificates.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_pending_ssl_certificates.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/Market/,\n    q/get_pending_ssl_certificates/,\n    {\n        'provider' => 'cPStore',\n    }\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_pending_ssl_certificates.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_pending_ssl_certificates.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    'Market',\n    'get_pending_ssl_certificates',\n    array (\n        'provider' => 'cPStore',\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"tags":[{"description":"The Market module for UAPI.","name":"Market"},{"name":"SSL Certificates","description":"Commerce Integration / SSL Certificates"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}]},"get_certificate_status_details":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The Market module for UAPI.","name":"Market"},{"description":"Commerce Integration / SSL Certificates","name":"SSL Certificates"}],"paths":{"/Market/get_certificate_status_details":{"get":{"summary":"Return provider's SSL certificate request status","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_certificate_status_details \\\n  order_item_id='1234567890' \\\n  provider='cPStore'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_certificate_status_details?order_item_id=1234567890&provider=cPStore","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_certificate_status_details.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_certificate_status_details.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/Market/,\n    q/get_certificate_status_details/,\n    {\n        'order_item_id' => '1234567890',\n        'provider' => 'cPStore',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_certificate_status_details.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_certificate_status_details.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    'Market',\n    'get_certificate_status_details',\n    array (\n        'order_item_id' => '1234567890',\n        'provider' => 'cPStore',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Market","SSL Certificates"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":["Certificate request is still being processed."]},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"properties":{"actionUrls":{"description":"An object that contains actionable URLs.","type":"object","properties":{"ovCallbackStatus":{"type":"string","example":"https://example.com/action","format":"url","description":"A URL that a user can use to expedite the validation process for Organization Validated (OV) certificates."},"evClickThroughStatus":{"example":"https://example.com/action","format":"url","description":"A URL that a user can use to expedite the validation process for Extended Validation (EV) certificates.","type":"string"}}},"domain_details":{"properties":{"status":{"type":"string","description":"The status of the domain's certificate.\n\n* `VALIDATED` - The domain has been validated.\n* `NOTVALIDATED` - The domain has **not** been validated.\n* `AWAITINGBRAND` - The domain has **not** been validated, and is awaiting brand approval.","enum":["VALIDATED","NOTVALIDATED","AWAITINGBRAND"],"example":"AWAITINGBRAND"},"domain":{"description":"The Fully Qualified Domain Name (FQDN) that the function queries.","format":"domain","example":"www.example.com","type":"string"}},"type":"object","description":"An object that contains information about the domain."},"status_details":{"description":"An object that contains specific information about the validation process.","properties":{"organizationValidationStatus":{"description":"Whether every requirement for the OV certificate has completed.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The OV certificate's requirements check is **not** complete.\n* `completed` - The OV certificate's requirements check is complete.\n* `in-progress` - The OV certificate's requirements check is in progress.","enum":["not applicable","not-completed","completed","in-progress"],"example":"not applicable","type":"string"},"certificateStatus":{"type":"string","example":"in-progress","enum":["not applicable","not-completed","completed","in-progress"],"description":"Whether the provider has issued the SSL certificate.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The certificate's issue is **not** completed.\n* `completed` - The provider has issued the certificate.\n* `in-progress` - The certificate's issue is in progress."},"csrStatus":{"enum":["not applicable","not-completed","completed","in-progress"],"example":"completed","description":"Whether the certificate signing request (CSR) has completed.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The CSR for the certificate is **not** complete.\n* `completed` - The CSR for the certificate is complete.\n* `in-progress` - The CSR for the certificate is in progress.","type":"string"},"ovCallbackStatus":{"enum":["not applicable","not-completed","completed","in-progress"],"example":"not applicable","description":"Whether the Certificate Authority (CA) has verified the organization's validity via a phone call.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The CA has **not** verified the organization's validity via phone.\n* `completed` - The CA has verified the organization's validity via phone.\n* `in-progress` - The CA's verification of the organization's validity via phone is in progress.","type":"string"},"evClickThroughStatus":{"example":"in-progress","enum":["not applicable","not-completed","completed","in-progress"],"description":"Whether every requirement for the EV certificate has completed.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The EV certificate's requirements check is **not** complete.\n* `completed` - The EV certificate's requirements check is complete.\n* `in-progress` - The EV certificate's requirements check is in progress.\n\nFor more information, read Sectigo's [What is required for validation?](https://support.sectigo.com/Com_KnowledgeDetailPage?Id=kA01N000000zFOr) documentation.","type":"string"},"freeDVUPStatus":{"type":"string","example":"not applicable","enum":["not applicable","not-completed","completed","in-progress"],"description":"Whether every requirement for the Domain Validated (DV) certificate has completed.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The DV certificate's requirements check is **not** complete.\n* `completed` - The DV certificate's requirements check is complete.\n* `in-progress` - The DV certificate's requirements check is in progress."},"dcvStatus":{"type":"string","description":"Whether Domain Control Validation (DCV) has completed.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The DCV for the certificate is **not** complete.\n* `completed` - The DCV for the certificate is complete.\n* `in-progress` - The DCV for the certificate is in progress.","enum":["not applicable","not-completed","completed","in-progress"],"example":"completed"},"brandValStatus":{"example":"in-progress","enum":["not applicable","not-completed","completed","in-progress"],"description":"Whether the brand validation status has completed.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The certificate's brand validation is **not** complete.\n* `completed` - The certificate's brand validation is complete.\n* `in-progress` - The certificate's brand validation is in progress.","type":"string"},"validationStatus":{"type":"string","description":"Whether the validation process has completed.\n\n* `not applicable` - This is **not** applicable for the certificate.\n* `not-completed` - The certificate's validation is **not** complete.\n* `completed` - The certificate's validation is complete.\n* `in-progress` - The certificate's validation is in progress.","example":"in-progress","enum":["not applicable","not-completed","completed","in-progress"]}},"type":"object"}},"type":"object"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"Market"},"func":{"example":"get_certificate_status_details","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPStore 76","parameters":[{"in":"query","name":"order_item_id","required":"true","description":"The order ID that the cPanel Market provider assigned.","schema":{"example":"1234567890","type":"integer","minimum":"1"}},{"description":"The cPanel Market provider's name.","schema":{"type":"string","example":"cPStore"},"name":"provider","in":"query","required":"true"}],"description":"This function returns the status of an SSL certificate request. The returns include\nactionable URLs for users to expedite the validation process, if applicable.\n\n**Important:**\n\nBecause this function returns data from a dynamic source, the returns in each\nobject can vary.","operationId":"get_certificate_status_details"}}},"x-tagGroups":[{"tags":["SSL Certificates"],"name":"Commerce Integration"}],"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"process_ssl_pending_queue":{"x-tagGroups":[{"name":"Commerce Integration","tags":["SSL Certificates"]}],"paths":{"/Market/process_ssl_pending_queue":{"get":{"x-cpanel-available-version":"cPanel 56","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"process_ssl_pending_queue","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"data":{"type":"array","description":"Information about each certificate request in the pending queue.","items":{"type":"object","properties":{"order_id":{"type":"string","description":"A unique identifier for the order.","example":"19461"},"vhost_names":{"type":"array","items":{"example":"example.com","format":"domain","type":"string"},"description":"A list of virtual host names."},"status":{"type":"string","example":"confirmed","enum":["confirmed","unconfirmed"],"description":"The status of the order.\n* `confirmed` - Payment confirmed.\n* `unconfirmed` - Payment **not** confirmed."},"provider":{"example":"cPStore","description":"The cPanel Market provider's name.","type":"string"},"csr":{"type":"string","format":"base64 certificate","description":"The Certificate Signing Request's (CSR's) text.","example":"-----BEGIN CERTIFICATE REQUEST-----\\nMIICqjCCAZICAQAwHDEaMBgGA1UEAxMRY3BhbmVsc3NsdGVzdC5vcmcwggEiMA0G\\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqu4KLPxCgAENTJFjcUyc4v5KaF8Lu\\n2OldjIT/vB58IRCIUxdDSD29v/qHFVBaUFEtr+Ssey0strMcc6JYSl8Vdwfe2qwv\\npB6+Ufg+hlN4lAgojxgwz7iZlPnGuRVfNTvNMmljVRzGDc4SSzskpDxZhk+aaMgP\\nSkMLFg6f6pFZ+44alridlSG5gxD34xWAtt8Qy2v+6Q4XVuMNCd9KlyAoCV9Q+wH1\\nq49yoRdwvcY6G6mqlFWtHsToz4tdYk/Nt7odZnyKcjHWGWnlRzO2FGbbBxVKF8s6\\ns3DL5OwPRfQQD18V7eL7NmcFo45zmdndBOevrLuwXJ1yWITM2bmYgF1nAgMBAAGg\\nSTBHBgkqhkiG9w0BCQ4xOjA4MDYGA1UdEQEB/wQsMCqCEWNwYW5lbHNzbHRlc3Qu\\nb3JnghV3d3cuY3BhbmVsc3NsdGVzdC5vcmcwDQYJKoZIhvcNAQELBQADggEBAFAJ\\nSqTvd3d8PN26UiT4uX0WjofaX8u1/11hU5Saekai0Dxl/ijq2R7TpebXe9r0t6Cr\\ns7NXKszVoKzQHV4nSFbfb3ZxEsnVDXbPUv3D+oLfGpMASLG+P2yOjmDhzZBNJgo4\\nQu6nf6ggJxJ0PRM81xL234FAKqsOvvTwTLXtYVrwbUCzfB+yKJXvfeGETR/3HGxR\\nqoJ97Zmjsbw78fETEsZ6rsBHDPuxtxum73BC7qoLjCl4psPznHshXvWTeV9fyR3c\\nqpdpLvwBxhI8ZOWoNGgJlUpY9jUFgqG+YI/Mkmzmxk9QC9edIHSScTXxroYkmwMC\\nginnKRLDafSp+7FyIzs=\\n-----END CERTIFICATE REQUEST-----"},"certificate_pem":{"type":"string","format":"base64 certificate","description":"The text of the certificate, if available.\n* `null` - The certificate is not available.","example":"null","nullable":"true"},"order_item_id":{"description":"A unique identifier of each item in the order.","example":"f9d7","type":"string"},"domains":{"items":{"type":"string","example":"example.com","format":"domain"},"description":"A list of domains that the certificate request covers.","type":"array"},"first_poll_time":{"type":"integer","format":"unix_timestamp","description":"The first time that the system polled the provider for the certificate.","example":"1458061262"},"product_id":{"type":"string","example":"fg2","description":"An identifier for a given product."},"deleted":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether the system has deleted the item from the pending queue.\n* `0` - Deleted.\n* `1` - **Not** deleted."},"created_time":{"type":"integer","example":"1460136406","description":"When the system placed the order.","format":"unix_timestamp"},"installed":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the system installed the certificate.\n* `1` - Installed.\n* `0` - **Not** installed."},"last_status_message":{"type":"string","example":"PRE-SIGN FAILED: CAA: Processing error","description":"An error message from the certificate provider.\nFor example, why a certificate authority rejected an SSL certificate.\n\n**Note:**\n\nIf no error message exists, this will return an empty string."},"last_status_code":{"type":"string","enum":["CertificateNotFound","RequiresApproval","OrderCanceled","OrderItemCanceled"],"example":"CertificateNotFound","description":"The last status code of the order.\n* `CertificateNotFound` - The system cannot locate the specified certificate.\n* `RequiresApproval` - The specified certificate requires approval.\n* `OrderCanceled` - The system canceled the order of the specified certificate.\n* `OrderItemCanceled` - The system canceled the order item of the specified certificate."},"expired":{"description":"Whether the system has deleted the item from the pending queue.\n* `1` - Deleted.\n* `0` - **Not** deleted.","example":"0","enum":["0","1"],"type":"integer"},"last_poll_time":{"example":"1458061299","format":"unix_timestamp","description":"The last time that the system polled the provider for the certificate.","type":"integer"}}}},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings\ndescribe non-critical failures or other problematic conditions\nnoted while running an API."}},"type":"object"},"module":{"description":"The name of the module called.","example":"Market","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"process_ssl_pending_queue","description":"This function manually processes the cPanel Market's SSL certificate request pending queue.","parameters":[],"summary":"Start processing pending queue's SSL certificates","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  process_ssl_pending_queue\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Market/process_ssl_pending_queue"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_process_ssl_pending_queue.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_process_ssl_pending_queue.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/Market/,\n    q/process_ssl_pending_queue/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_process_ssl_pending_queue.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_process_ssl_pending_queue.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    'Market',\n    'process_ssl_pending_queue'\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}"}],"tags":["Market","SSL Certificates"]}}},"tags":[{"description":"The Market module for UAPI.","name":"Market"},{"description":"Commerce Integration / SSL Certificates","name":"SSL Certificates"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"create_shopping_cart":{"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Market","description":"The Market module for UAPI."},{"description":"Commerce Integration / Market Integration","name":"Market Integration"}],"paths":{"/Market/create_shopping_cart":{"get":{"summary":"Create shopping cart","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  create_shopping_cart \\\n  provider='cPStore' \\\n  access_token='1a676e6f-99fc-11e6-9ab6-e60a769b73bc' \\\n  url_after_checkout='http://www.example.com/thenextplace' \\\n  item='{\"product_id\":123456,\"provider-specfic-key\":\"provider-specfic-value\",\"another-provider-specfic-key\":\"another-provider-specfic-value\"}' item='{\"product_id\":123457,\"provider-specfic-key\":\"provider-specfic-value\",\"another-provider-specfic-key\":\"another-provider-specfic-value\"}'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/create_shopping_cart?provider=cPStore&access_token=1a676e6f-99fc-11e6-9ab6-e60a769b73bc&url_after_checkout=http%3a%2f%2fwww.example.com%2fthenextplace&item=%7b%22product_id%22%3a123456%2c%22provider-specfic-key%22%3a%22provider-specfic-value%22%2c%22another-provider-specfic-key%22%3a%22another-provider-specfic-value%22%7d&item=%7b%22product_id%22%3a123457%2c%22provider-specfic-key%22%3a%22provider-specfic-value%22%2c%22another-provider-specfic-key%22%3a%22another-provider-specfic-value%22%7d","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_create_shopping_cart.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_create_shopping_cart.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/Market/,\n    q/create_shopping_cart/,\n    {\n        'provider' => 'cPStore',\n        'access_token' => '1a676e6f-99fc-11e6-9ab6-e60a769b73bc',\n        'url_after_checkout' => 'http://www.example.com/thenextplace',\n        'item' => '{\"product_id\":123456,\"provider-specfic-key\":\"provider-specfic-value\",\"another-provider-specfic-key\":\"another-provider-specfic-value\"}'&item='{\"product_id\":123457,\"provider-specfic-key\":\"provider-specfic-value\",\"another-provider-specfic-key\":\"another-provider-specfic-value\"}',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_create_shopping_cart.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_create_shopping_cart.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    'Market',\n    'create_shopping_cart',\n    array (\n        'provider' => 'cPStore',\n        'access_token' => '1a676e6f-99fc-11e6-9ab6-e60a769b73bc',\n        'url_after_checkout' => 'http://www.example.com/thenextplace',\n        'item' => '{\"product_id\":123456,\"provider-specfic-key\":\"provider-specfic-value\",\"another-provider-specfic-key\":\"another-provider-specfic-value\"}'&item='{\"product_id\":123457,\"provider-specfic-key\":\"provider-specfic-value\",\"another-provider-specfic-key\":\"another-provider-specfic-value\"}',\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}"}],"tags":["Market","Market Integration"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Market","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"example":"1","enum":["0","1"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"properties":{"order_id":{"description":"The order’s ID.","example":"8765309","type":"string"},"order_items":{"type":"array","description":"An array of objects that contain information about Items in the shopping cart. The function returns these values in the order in which you called them. This array of objects returns values that vary between providers.","items":{"type":"object"}},"checkout_url":{"type":"string","description":"The location of the provider’s check out page.","format":"url","example":"http://www.example.com/checkout"}},"type":"object"}},"type":"object"},"func":{"description":"The name of the method called.","example":"create_shopping_cart","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 62","parameters":[{"name":"provider","in":"query","required":"true","description":"The cPanel Market provider’s name.","schema":{"example":"cPStore","type":"string"}},{"schema":{"example":"1a676e6f-99fc-11e6-9ab6-e60a769b73bc","format":"uuid","type":"string"},"description":"The access token to connect to the provider.","required":"true","name":"access_token","in":"query"},{"name":"url_after_checkout","in":"query","required":"true","description":"The location to which the provider directs the user after the checkout process is complete.","schema":{"example":"http://www.example.com/thenextplace","format":"url","type":"string"}},{"style":"form","description":"The items to add to the shopping cart.\n\n**Note**:\n\n  The value is a JSON string.\n\n  This object has one required key, `product_id`, which is a string.\n\n  The other keys/values in this object vary depending on the provider.","in":"query","name":"item","required":"true","example":["{\"product_id\":123456,\"provider-specfic-key\":\"provider-specfic-value\",\"another-provider-specfic-key\":\"another-provider-specfic-value\"}","{\"product_id\":123457,\"provider-specfic-key\":\"provider-specfic-value\",\"another-provider-specfic-key\":\"another-provider-specfic-value\"}"],"explode":"true","schema":{"items":{"format":"json","type":"string"},"type":"array"}}],"operationId":"create_shopping_cart","description":"This function creates a shopping cart with which the system sends an order to the cPanel Store. Typically, the system will send shopping cart orders for SSL certificates to UAPI’s `Market::request_ssl_certificates` function."}}},"x-tagGroups":[{"name":"Commerce Integration","tags":["Market Integration"]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface’s features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"get_login_url":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"tags":[{"description":"The Market module for UAPI.","name":"Market"},{"description":"Commerce Integration / Market Integration","name":"Market Integration"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"name":"Commerce Integration","tags":["Market Integration"]}],"paths":{"/Market/get_login_url":{"get":{"summary":"Return provider's login URL","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_login_url \\\n  provider='cPStore' \\\n  url_after_login='http://hostname.example.com/redirectionlocation.cgi?state'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_login_url?provider=cPStore&url_after_login=http%3a%2f%2fhostname.example.com%2fredirectionlocation.cgi%3fstate","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_login_url.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_login_url.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/Market/,\n    q/get_login_url/,\n    {\n        'provider' => 'cPStore',\n        'url_after_login' => 'http://hostname.example.com/redirectionlocation.cgi?state',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_login_url.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_login_url.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    'Market',\n    'get_login_url',\n    array (\n        'provider' => 'cPStore',\n        'url_after_login' => 'http://hostname.example.com/redirectionlocation.cgi?state',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Market","Market Integration"],"x-cpanel-available-version":"cPanel 56","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"data":{"format":"url","description":"The URL to which to redirect the browser after login.","example":"https://example.com/api/?client_id=MyHearseIsAmazing&function=login&module=bogoSSL&redirect_uri=https%3A%2F%2Fqaportal.cpanel.net%2Fbogus.cgi&response_type=token","type":"string"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Market","description":"The name of the module called."},"func":{"example":"get_login_url","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"get_login_url","description":"This function retrieves the login URL for the cPanel Market provider.","parameters":[{"description":"The cPanel Market provider's name.","schema":{"type":"string","example":"cPStore"},"name":"provider","in":"query","required":"true"},{"description":"Where the cPanel Market provider redirects the user's browser after they log in.","schema":{"example":"http://hostname.example.com/redirectionlocation.cgi?state","format":"url","type":"string"},"name":"url_after_login","in":"query","required":"true"}]}}}},"get_build_cart_url":{"paths":{"/Market/get_build_cart_url":{"get":{"x-cpanel-available-version":"cPanel 62","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Market","description":"The name of the module called."},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"metadata":{"properties":{}},"data":{"properties":{"url":{"example":"https://hostname.example.com:2083/cpsessXXXXXXXXXX/frontend/jupiter/store/purchase_product_build_cart.html?product_name=cpanel-ssl","description":"The full cPanel URL for the product purchase cart page, including the security token.","format":"url","type":"string"}},"type":"object"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"example":"get_build_cart_url","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function builds the URL for the shopping cart page for the specified product. The system saves session data and constructs a full cPanel URL pointing to the product purchase page.","operationId":"get_build_cart_url","parameters":[{"name":"product_name","in":"query","required":"true","description":"The name of the product for which to build the cart URL.","schema":{"example":"cpanel-ssl","type":"string"}},{"required":"false","in":"query","name":"domain","schema":{"example":"example.com","type":"string"},"description":"The domain associated with the product purchase. This parameter is optional."}],"x-cpanel-api-version":"UAPI","summary":"Build cart URL for a product","tags":["Market","Market Integration"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_build_cart_url \\\n  product_name='cpanel-ssl' \\\n  domain='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_build_cart_url?product_name=cpanel-ssl&domain=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_build_cart_url.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_build_cart_url.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/Market/,\n    q/get_build_cart_url/,\n    {\n        'product_name' => 'cpanel-ssl',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_build_cart_url.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_build_cart_url.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    'Market',\n    'get_build_cart_url',\n    array (\n        'product_name' => 'cpanel-ssl',\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"tags":["Market Integration"],"name":"Commerce Integration"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Market","description":"The Market module for UAPI."},{"description":"Commerce Integration / Market Integration","name":"Market Integration"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"set_url_after_checkout":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"name":"Market","description":"The Market module for UAPI."},{"name":"Market Integration","description":"Commerce Integration / Market Integration"}],"paths":{"/Market/set_url_after_checkout":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update URL after checkout","tags":["Market","Market Integration"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  set_url_after_checkout \\\n  provider='cPStore' \\\n  access_token='725431a1-d5bc-11e5-a28b-8b0e09a93f05' \\\n  order_id='123456' \\\n  url_after_checkout='http://checkout.example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Market/set_url_after_checkout?provider=cPStore&access_token=725431a1-d5bc-11e5-a28b-8b0e09a93f05&order_id=123456&url_after_checkout=http%3a%2f%2fcheckout.example.com","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_set_url_after_checkout.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_set_url_after_checkout.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/Market/,\n    q/set_url_after_checkout/,\n    {\n        'provider' => 'cPStore',\n        'access_token' => '725431a1-d5bc-11e5-a28b-8b0e09a93f05',\n        'order_id' => '123456',\n        'url_after_checkout' => 'http://checkout.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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_set_url_after_checkout.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_set_url_after_checkout.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    'Market',\n    'set_url_after_checkout',\n    array (\n        'provider' => 'cPStore',\n        'access_token' => '725431a1-d5bc-11e5-a28b-8b0e09a93f05',\n        'order_id' => '123456',\n        'url_after_checkout' => 'http://checkout.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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 56","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"type":"object","properties":{"error_type":{"description":"Any errors that the function encounters.","example":"This is an error.","nullable":"true","type":"string"}}},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"Market"},"func":{"type":"string","example":"set_url_after_checkout","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"set_url_after_checkout","description":"This function updates the URL to which a provider sends a user after they check out.","parameters":[{"in":"query","name":"provider","required":"true","description":"The cPanel Market provider's name.","schema":{"example":"cPStore","type":"string"}},{"schema":{"type":"string","example":"725431a1-d5bc-11e5-a28b-8b0e09a93f05"},"description":"The access token for the session to the cPanel Market provider.","required":"true","in":"query","name":"access_token"},{"required":"true","in":"query","name":"order_id","schema":{"example":"123456","type":"integer"},"description":"The order ID that the cPanel Market provider assigned."},{"required":"true","name":"url_after_checkout","in":"query","schema":{"format":"url","example":"http://checkout.example.com","type":"string"},"description":"The URL to send the browser after the user checks out."}]}}},"x-tagGroups":[{"tags":["Market Integration"],"name":"Commerce Integration"}],"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"get_all_products":{"tags":[{"name":"Market","description":"The Market module for UAPI."},{"name":"Market Integration","description":"Commerce Integration / Market Integration"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Commerce Integration","tags":["Market Integration"]}],"paths":{"/Market/get_all_products":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/MarketProviderProductMetaDataType"}},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"Market","description":"The name of the module called."},"func":{"type":"string","example":"get_all_products","description":"The name of the method called."}},"type":"object"},"examples":{"ssl_certificate":{"description":"product_group=ssl_certificate","value":{"func":"get_all_products","result":{"data":[{"price_unit":"USD","description":"An extended-validated (EV) SSL certificate signed by COMODO.","x_price_per_domain_minimum":"108","provider_name":"cPStore","x_max_http_redirects":"0","price":null,"product_id":"155","x_certificate_term":["1","year"],"provider_display_name":"cPanel Store","x_payment_trigger":"checkout","max_users":null,"product_category":"N/A","base_name":"","x_warn_after":"604800","x_validation_type":"ev","billing_type":"one-time","license_term":"0","product_group":"ssl_certificate","recommended":"0","icon_mime_type":"image/svg+xml","x_price_per_domain_maximum":"1080","x_supports_dns_dcv":"1","product":"Comodo EV Certificate","maximum_server_price":null,"x_identity_verification":[{"label":"Organization Name","name":"organizationName"},{"name":"organizationalUnitName","label":"Department Name","is_optional":"1"},{"is_optional":"1","label":"Dun & Bradstreet D-U-N-S (Data Universal Numbering System) Number","description":"9 consecutive digits or “##-###-####” (More information (https://go.cpanel.net/get_duns))","pattern":"^[0-9]{2}(?:-[0-9]{3}-[0-9]{4}|[0-9]{7})$","name":"duns_number"},{"label":"Street Address","name":"streetAddress"},{"label":"City","name":"localityName"},{"label":"State or Province","name":"stateOrProvinceName"},{"name":"postalCode","label":"Postal Code"},{"label":"Country Code","name":"countryName","type":"country_code"},{"label":"Representative’s Given (First) Name","name":"rep_forename"},{"name":"rep_surname","label":"Representative’s Surname (Last Name)"},{"type":"email","name":"rep_email_address","label":"Representative’s Email Address"},{"is_optional":"1","label":"Representative’s Telephone Number","description":"This should be one of the organization’s publicly-listed telephone numbers.","type":"tel","name":"rep_telephone"},{"type":"choose_one","name":"business_category","options":[["b","Incorporated Business (“Private Organization”)"],["d","Non-incorporated Business (“Business Entity”)"],["c","Government Entity (“Government Entity”)"]],"label":"Business Category","description":"Consult the EV SSL Certificate Guidelines (https://cabforum.org/extended-validation/) for more information about this field’s options."},{"name":"joi_locality_name","is_optional":"1","label":"City Where Incorporated (JOI (Jurisdiction of Incorporation))"},{"label":"State or Province Where Incorporated (JOI (Jurisdiction of Incorporation))","is_optional":"1","name":"joi_state_or_province_name"},{"type":"country_code","name":"joi_country_name","label":"Country Code Where Incorporated (JOI (Jurisdiction of Incorporation))"},{"name":"date_of_incorporation","type":"date","label":"Date of Incorporation","is_optional":"1"},{"name":"assumed_name","label":"Assumed Name (DBA (Doing Business As))","is_optional":"1"}],"x_ssl_per_domain_pricing":"1","icon":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNTUwIiB3aWR0aD0iNDE3LjE2Ij48ZyBmaWxsPSIjMzViNTZjIj48cGF0aCBkPSJNNDE0LjM5NiAyNmM3LTExIDAtMjYtMTMtMjZIMTg3LjM5NWMtNDUgMC04MSAxMi0xMDcgMzZzLTQyIDU4LTQ2IDEwM2wtMTAgMTE2Yy00IDQ1IDUgNzkgMjggMTAzIDIyIDI0IDU2IDM2IDEwMSAzNmg0OXYtMWM5LjAwMS0xIDE1LjAwMS03IDE2LjAwMS0xN2w1LTU3YzAtMTEtNy0xOS0xOC4wMDEtMTloLTI3Yy0xNyAwLTMwLTQtMzctMTItNy03LTEwLTIwLTgtMzlsOS0xMDRjMi0xOCA3LTMxIDE1LTM5czIxLTEyIDM5LTEyaDE0NC4wMDFjMTcgMCAzNC05IDQ0LTIzbDMwLTQ1Ii8+PHBhdGggZD0iTTMuMzk1IDUyNGMtOCAxMS0xIDI2IDEyIDI2aDIxNy4wMDFjNDUgMCA4MS0xMiAxMDgtMzYgMjYtMjQgNDEtNTggNDUtMTAybDExLTExN2MzLTQ1LTYtNzktMjgtMTAzLTIzLTI0LTU2LTM2LTEwMS0zNmgtNDl2MWMtMTAuMDAxIDEtMTUuMDAxIDctMTYuMDAxIDE3bC01IDU4Yy0xIDEwIDcgMTggMTcuMDAxIDE4aDI3YzE4IDAgMzAgNCAzNyAxMnMxMCAyMSA5IDM5bC0xMCAxMDRjLTEgMTktNiAzMi0xNCAzOS05IDgtMjIgMTItNDAgMTJINzYuMzk1Yy0xNyAwLTMzIDktNDMgMjRsLTMwIDQ0Ii8+PC9nPjwvc3ZnPg==","x_price_per_domain":"108","enabled":"1","minimum_server_price":null,"requires_ip":"0","display_name":"Comodo EV SSL Certificate"},{"product_id":"217","x_price_per_wildcard_domain":"150.00","price":null,"x_max_http_redirects":"0","provider_name":"cPStore","x_price_per_domain_minimum":"36","description":"An organization-validated (OV) SSL certificate signed by COMODO.","x_price_per_wildcard_domain_minimum":"150.00","price_unit":"USD","x_price_per_wildcard_domain_maximum":"1500.00","product_group":"ssl_certificate","license_term":"0","billing_type":"one-time","x_validation_type":"ov","x_warn_after":"604800","base_name":"","product_category":"N/A","max_users":null,"x_payment_trigger":"checkout","provider_display_name":"cPanel Store","x_certificate_term":["1","year"],"x_ssl_per_domain_pricing":"1","x_identity_verification":[{"label":"Organization Name","name":"organizationName"},{"name":"organizationalUnitName","label":"Department Name","is_optional":"1"},{"pattern":"^[0-9]{2}(?:-[0-9]{3}-[0-9]{4}|[0-9]{7})$","name":"duns_number","description":"9 consecutive digits or “##-###-####” (More information (https://go.cpanel.net/get_duns))","label":"Dun & Bradstreet D-U-N-S (Data Universal Numbering System) Number","is_optional":"1"},{"name":"streetAddress","label":"Street Address"},{"label":"City","name":"localityName"},{"name":"stateOrProvinceName","label":"State or Province"},{"label":"Postal Code","name":"postalCode"},{"name":"countryName","type":"country_code","label":"Country Code"},{"label":"Representative’s Given (First) Name","name":"rep_forename"},{"name":"rep_surname","label":"Representative’s Surname (Last Name)"},{"label":"Representative’s Email Address","name":"rep_email_address","type":"email"},{"is_optional":"1","description":"This should be one of the organization’s publicly-listed telephone numbers.","label":"Representative’s Telephone Number","type":"tel","name":"rep_telephone"}],"maximum_server_price":null,"product":"Comodo OV Certificate","x_supports_dns_dcv":"1","x_price_per_domain_maximum":"360","icon_mime_type":"image/svg+xml","recommended":"0","display_name":"Comodo OV SSL Certificate","x_wildcard_parent_domain_free":"1","requires_ip":"0","minimum_server_price":null,"icon":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNTUwIiB3aWR0aD0iNDE3LjE2Ij48ZyBmaWxsPSIjMzViNTZjIj48cGF0aCBkPSJNNDE0LjM5NiAyNmM3LTExIDAtMjYtMTMtMjZIMTg3LjM5NWMtNDUgMC04MSAxMi0xMDcgMzZzLTQyIDU4LTQ2IDEwM2wtMTAgMTE2Yy00IDQ1IDUgNzkgMjggMTAzIDIyIDI0IDU2IDM2IDEwMSAzNmg0OXYtMWM5LjAwMS0xIDE1LjAwMS03IDE2LjAwMS0xN2w1LTU3YzAtMTEtNy0xOS0xOC4wMDEtMTloLTI3Yy0xNyAwLTMwLTQtMzctMTItNy03LTEwLTIwLTgtMzlsOS0xMDRjMi0xOCA3LTMxIDE1LTM5czIxLTEyIDM5LTEyaDE0NC4wMDFjMTcgMCAzNC05IDQ0LTIzbDMwLTQ1Ii8+PHBhdGggZD0iTTMuMzk1IDUyNGMtOCAxMS0xIDI2IDEyIDI2aDIxNy4wMDFjNDUgMCA4MS0xMiAxMDgtMzYgMjYtMjQgNDEtNTggNDUtMTAybDExLTExN2MzLTQ1LTYtNzktMjgtMTAzLTIzLTI0LTU2LTM2LTEwMS0zNmgtNDl2MWMtMTAuMDAxIDEtMTUuMDAxIDctMTYuMDAxIDE3bC01IDU4Yy0xIDEwIDcgMTggMTcuMDAxIDE4aDI3YzE4IDAgMzAgNCAzNyAxMnMxMCAyMSA5IDM5bC0xMCAxMDRjLTEgMTktNiAzMi0xNCAzOS05IDgtMjIgMTItNDAgMTJINzYuMzk1Yy0xNyAwLTMzIDktNDMgMjRsLTMwIDQ0Ii8+PC9nPjwvc3ZnPg==","x_price_per_domain":"36","enabled":"1"},{"x_price_per_domain_minimum":"3","provider_name":"cPStore","x_price_per_wildcard_domain_minimum":"75.00","description":"A domain-validated (DV) SSL certificate signed by cPanel.","price_unit":"USD","product_id":"159","x_price_per_wildcard_domain":"75.00","price":null,"x_max_http_redirects":"0","max_users":null,"product_category":"N/A","base_name":"","x_payment_trigger":"issuance","x_certificate_term":["1","year"],"provider_display_name":"cPanel Store","product_group":"ssl_certificate","x_price_per_wildcard_domain_maximum":"750.00","billing_type":"one-time","x_validation_type":"dv","license_term":"0","x_warn_after":"604800","maximum_server_price":null,"x_supports_dns_dcv":"1","product":"cPanel DV Certificate","icon_mime_type":"image/svg+xml","x_price_per_domain_maximum":"30","recommended":"0","x_ssl_per_domain_pricing":"1","x_identity_verification":null,"minimum_server_price":null,"x_price_per_domain":"9","enabled":"1","icon":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNTlwdCIgaGVpZ2h0PSIzMjAiIHZpZXdCb3g9IjAgMCAzNTkgMjQwIj48ZGVmcz48Y2xpcFBhdGggaWQ9ImEiPjxwYXRoIGQ9Ik0xMjMgMGgyMzUuMzd2MjQwSDEyM3ptMCAwIi8+PC9jbGlwUGF0aD48L2RlZnM+PHBhdGggZD0iTTg5LjY5IDU5LjEwMmg2Ny44MDJsLTEwLjUgNDAuMmMtMS42MDUgNS42LTQuNjA1IDEwLjEtOSAxMy41LTQuNDAyIDMuNC05LjUwNCA1LjA5Ni0xNS4zIDUuMDk2aC0zMS41Yy03LjIgMC0xMy41NSAyLjEwMi0xOS4wNSA2LjMtNS41MDUgNC4yLTkuMzUzIDkuOTA0LTExLjU1MiAxNy4xMDMtMS40IDUuNDAzLTEuNTUgMTAuNS0uNDUgMTUuMzAyIDEuMDk4IDQuNzk2IDMuMDQ3IDkuMDUgNS44NTIgMTIuNzUgMi43OTcgMy43MDMgNi40IDYuNjUyIDEwLjc5NyA4Ljg1IDQuMzk3IDIuMiA5LjE5OCAzLjI5OCAxNC40IDMuMjk4aDE5LjJjMy42MDIgMCA2LjU0NyAxLjQ1MyA4Ljg1MiA0LjM1MiAyLjI5NyAyLjkwMiAyLjk0NSA2LjE0OCAxLjk1IDkuNzVsLTEyIDQ0LjM5OGgtMjFjLTE0LjQwMyAwLTI3LjY1My0zLjE0OC0zOS43NS05LjQ1LTEyLjEwMi02LjMtMjIuMTUzLTE0LjY0OC0zMC4xNTMtMjUuMDUtOC0xMC4zOTUtMTMuNDU0LTIyLjI0Ni0xNi4zNS0zNS41NDctMi45LTEzLjMtMi41NS0yNi45NSAxLjA1Mi00MC45NTNsMS4yLTQuNWMyLjU5Ny05LjYwMiA2LjY0OC0xOC40NSAxMi4xNDgtMjYuNTUgNS41LTguMDk4IDEyLTE1IDE5LjUtMjAuNyA3LjUtNS43IDE1Ljg1LTEwLjE0OCAyNS4wNS0xMy4zNTIgOS4yLTMuMTk1IDE4Ljc5Ny00Ljc5NiAyOC44LTQuNzk2IiBmaWxsPSIjZmY2YzJjIi8+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBkPSJNMTIzLjg5IDI0MEwxODIuOTkgMTguNjAyYzEuNTk4LTUuNTk4IDQuNTk4LTEwLjA5OCA5LTEzLjVDMTk2LjM4OCAxLjcgMjAxLjQ4NCAwIDIwNy4yODggMGg2Mi43YzE0LjQwMyAwIDI3LjY1IDMuMTQ4IDM5Ljc1IDkuNDUgMTIuMTAyIDYuMyAyMi4xNTMgMTQuNjU1IDMwLjE1MyAyNS4wNSA3Ljk5NyAxMC40MDIgMTMuNSAyMi4yNTQgMTYuNSAzNS41NSAzIDEzLjMwNSAyLjU5NCAyNi45NTQtMS4yMDIgNDAuOTVsLTEuMiA0LjVjLTIuNTk3IDkuNjAyLTYuNTk3IDE4LjQ1LTEyIDI2LjU1LTUuMzk4IDguMDk4LTExLjg0NyAxNS4wNTItMTkuMzQ3IDIwLjg0OC03LjUgNS44MDUtMTUuODU1IDEwLjMwNS0yNS4wNSAxMy41LTkuMiAzLjIwNC0xOC44MDUgNC44MDUtMjguODA1IDQuODA1aC01NC4yOTdsMTAuOC00MC41YzEuNi01LjQwMiA0LjYtOS44IDktMTMuMjAzIDQuMzk2LTMuMzk4IDkuNDk3LTUuMTAyIDE1LjMwMi01LjEwMmgxNy4zOThjNy4yIDAgMTMuNjUzLTIuMiAxOS4zNTItNi41OTcgNS42OTUtNC4zOTggOS40NDUtMTAuMDk3IDExLjI1LTE3LjEgMS4zOTQtNC45OTcgMS41NDctOS45LjQ0NS0xNC43LTEuMS00LjgtMy4wNS05LjA0Ny01Ljg0OC0xMi43NS0yLjgtMy42OTUtNi40MDItNi42OTUtMTAuNzk2LTktNC40MDYtMi4yOTctOS4yMDYtMy40NS0xNC40MDItMy40NUgyMzMuMzlsLTQzLjggMTYyLjkwM2MtMS42MDYgNS40LTQuNjA2IDkuNzk3LTkgMTMuMTk1LTQuNDAzIDMuNDA3LTkuNDA2IDUuMTAyLTE1IDUuMTAyaC00MS43IiBmaWxsPSIjZmY2YzJjIi8+PC9nPjwvc3ZnPgo=","display_name":"cPanel DV SSL Certificate","x_wildcard_parent_domain_free":"1","requires_ip":"0"},{"x_price_per_domain":"30","icon":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNTlwdCIgaGVpZ2h0PSIzMjAiIHZpZXdCb3g9IjAgMCAzNTkgMjQwIj48ZGVmcz48Y2xpcFBhdGggaWQ9ImEiPjxwYXRoIGQ9Ik0xMjMgMGgyMzUuMzd2MjQwSDEyM3ptMCAwIi8+PC9jbGlwUGF0aD48L2RlZnM+PHBhdGggZD0iTTg5LjY5IDU5LjEwMmg2Ny44MDJsLTEwLjUgNDAuMmMtMS42MDUgNS42LTQuNjA1IDEwLjEtOSAxMy41LTQuNDAyIDMuNC05LjUwNCA1LjA5Ni0xNS4zIDUuMDk2aC0zMS41Yy03LjIgMC0xMy41NSAyLjEwMi0xOS4wNSA2LjMtNS41MDUgNC4yLTkuMzUzIDkuOTA0LTExLjU1MiAxNy4xMDMtMS40IDUuNDAzLTEuNTUgMTAuNS0uNDUgMTUuMzAyIDEuMDk4IDQuNzk2IDMuMDQ3IDkuMDUgNS44NTIgMTIuNzUgMi43OTcgMy43MDMgNi40IDYuNjUyIDEwLjc5NyA4Ljg1IDQuMzk3IDIuMiA5LjE5OCAzLjI5OCAxNC40IDMuMjk4aDE5LjJjMy42MDIgMCA2LjU0NyAxLjQ1MyA4Ljg1MiA0LjM1MiAyLjI5NyAyLjkwMiAyLjk0NSA2LjE0OCAxLjk1IDkuNzVsLTEyIDQ0LjM5OGgtMjFjLTE0LjQwMyAwLTI3LjY1My0zLjE0OC0zOS43NS05LjQ1LTEyLjEwMi02LjMtMjIuMTUzLTE0LjY0OC0zMC4xNTMtMjUuMDUtOC0xMC4zOTUtMTMuNDU0LTIyLjI0Ni0xNi4zNS0zNS41NDctMi45LTEzLjMtMi41NS0yNi45NSAxLjA1Mi00MC45NTNsMS4yLTQuNWMyLjU5Ny05LjYwMiA2LjY0OC0xOC40NSAxMi4xNDgtMjYuNTUgNS41LTguMDk4IDEyLTE1IDE5LjUtMjAuNyA3LjUtNS43IDE1Ljg1LTEwLjE0OCAyNS4wNS0xMy4zNTIgOS4yLTMuMTk1IDE4Ljc5Ny00Ljc5NiAyOC44LTQuNzk2IiBmaWxsPSIjZmY2YzJjIi8+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBkPSJNMTIzLjg5IDI0MEwxODIuOTkgMTguNjAyYzEuNTk4LTUuNTk4IDQuNTk4LTEwLjA5OCA5LTEzLjVDMTk2LjM4OCAxLjcgMjAxLjQ4NCAwIDIwNy4yODggMGg2Mi43YzE0LjQwMyAwIDI3LjY1IDMuMTQ4IDM5Ljc1IDkuNDUgMTIuMTAyIDYuMyAyMi4xNTMgMTQuNjU1IDMwLjE1MyAyNS4wNSA3Ljk5NyAxMC40MDIgMTMuNSAyMi4yNTQgMTYuNSAzNS41NSAzIDEzLjMwNSAyLjU5NCAyNi45NTQtMS4yMDIgNDAuOTVsLTEuMiA0LjVjLTIuNTk3IDkuNjAyLTYuNTk3IDE4LjQ1LTEyIDI2LjU1LTUuMzk4IDguMDk4LTExLjg0NyAxNS4wNTItMTkuMzQ3IDIwLjg0OC03LjUgNS44MDUtMTUuODU1IDEwLjMwNS0yNS4wNSAxMy41LTkuMiAzLjIwNC0xOC44MDUgNC44MDUtMjguODA1IDQuODA1aC01NC4yOTdsMTAuOC00MC41YzEuNi01LjQwMiA0LjYtOS44IDktMTMuMjAzIDQuMzk2LTMuMzk4IDkuNDk3LTUuMTAyIDE1LjMwMi01LjEwMmgxNy4zOThjNy4yIDAgMTMuNjUzLTIuMiAxOS4zNTItNi41OTcgNS42OTUtNC4zOTggOS40NDUtMTAuMDk3IDExLjI1LTE3LjEgMS4zOTQtNC45OTcgMS41NDctOS45LjQ0NS0xNC43LTEuMS00LjgtMy4wNS05LjA0Ny01Ljg0OC0xMi43NS0yLjgtMy42OTUtNi40MDItNi42OTUtMTAuNzk2LTktNC40MDYtMi4yOTctOS4yMDYtMy40NS0xNC40MDItMy40NUgyMzMuMzlsLTQzLjggMTYyLjkwM2MtMS42MDYgNS40LTQuNjA2IDkuNzk3LTkgMTMuMTk1LTQuNDAzIDMuNDA3LTkuNDA2IDUuMTAyLTE1IDUuMTAyaC00MS43IiBmaWxsPSIjZmY2YzJjIi8+PC9nPjwvc3ZnPgo=","enabled":"1","minimum_server_price":null,"requires_ip":"0","display_name":"cPanel OV SSL Certificate","x_wildcard_parent_domain_free":"1","x_price_per_domain_maximum":"300","icon_mime_type":"image/svg+xml","recommended":"0","maximum_server_price":null,"product":"cPanel OV Certificate","x_supports_dns_dcv":"1","x_identity_verification":[{"name":"organizationName","label":"Organization Name"},{"name":"organizationalUnitName","label":"Department Name","is_optional":"1"},{"name":"duns_number","pattern":"^[0-9]{2}(?:-[0-9]{3}-[0-9]{4}|[0-9]{7})$","is_optional":"1","description":"9 consecutive digits or “##-###-####” (More information (https://go.cpanel.net/get_duns))","label":"Dun & Bradstreet D-U-N-S (Data Universal Numbering System) Number"},{"label":"Street Address","name":"streetAddress"},{"label":"City","name":"localityName"},{"name":"stateOrProvinceName","label":"State or Province"},{"label":"Postal Code","name":"postalCode"},{"type":"country_code","name":"countryName","label":"Country Code"},{"label":"Representative’s Given (First) Name","name":"rep_forename"},{"label":"Representative’s Surname (Last Name)","name":"rep_surname"},{"name":"rep_email_address","type":"email","label":"Representative’s Email Address"},{"name":"rep_telephone","type":"tel","label":"Representative’s Telephone Number","description":"This should be one of the organization’s publicly-listed telephone numbers.","is_optional":"1"}],"x_ssl_per_domain_pricing":"1","provider_display_name":"cPanel Store","x_certificate_term":["1","year"],"base_name":"","product_category":"N/A","max_users":null,"x_payment_trigger":"checkout","license_term":"0","billing_type":"one-time","x_validation_type":"ov","x_warn_after":"604800","x_price_per_wildcard_domain_maximum":"990.00","product_group":"ssl_certificate","description":"An organization-validated (OV) SSL certificate signed by cPanel.","x_price_per_wildcard_domain_minimum":"99.00","price_unit":"USD","x_price_per_domain_minimum":"30","provider_name":"cPStore","price":null,"x_max_http_redirects":"0","x_price_per_wildcard_domain":"99.00","product_id":"213"},{"x_ssl_per_domain_pricing":"1","x_identity_verification":null,"maximum_server_price":null,"product":"Comodo DV Certificate","x_supports_dns_dcv":"1","icon_mime_type":"image/svg+xml","x_price_per_domain_maximum":"120","recommended":"0","display_name":"Comodo DV SSL Certificate","x_wildcard_parent_domain_free":"1","requires_ip":"0","minimum_server_price":null,"x_price_per_domain":"12","enabled":"1","icon":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNTUwIiB3aWR0aD0iNDE3LjE2Ij48ZyBmaWxsPSIjMzViNTZjIj48cGF0aCBkPSJNNDE0LjM5NiAyNmM3LTExIDAtMjYtMTMtMjZIMTg3LjM5NWMtNDUgMC04MSAxMi0xMDcgMzZzLTQyIDU4LTQ2IDEwM2wtMTAgMTE2Yy00IDQ1IDUgNzkgMjggMTAzIDIyIDI0IDU2IDM2IDEwMSAzNmg0OXYtMWM5LjAwMS0xIDE1LjAwMS03IDE2LjAwMS0xN2w1LTU3YzAtMTEtNy0xOS0xOC4wMDEtMTloLTI3Yy0xNyAwLTMwLTQtMzctMTItNy03LTEwLTIwLTgtMzlsOS0xMDRjMi0xOCA3LTMxIDE1LTM5czIxLTEyIDM5LTEyaDE0NC4wMDFjMTcgMCAzNC05IDQ0LTIzbDMwLTQ1Ii8+PHBhdGggZD0iTTMuMzk1IDUyNGMtOCAxMS0xIDI2IDEyIDI2aDIxNy4wMDFjNDUgMCA4MS0xMiAxMDgtMzYgMjYtMjQgNDEtNTggNDUtMTAybDExLTExN2MzLTQ1LTYtNzktMjgtMTAzLTIzLTI0LTU2LTM2LTEwMS0zNmgtNDl2MWMtMTAuMDAxIDEtMTUuMDAxIDctMTYuMDAxIDE3bC01IDU4Yy0xIDEwIDcgMTggMTcuMDAxIDE4aDI3YzE4IDAgMzAgNCAzNyAxMnMxMCAyMSA5IDM5bC0xMCAxMDRjLTEgMTktNiAzMi0xNCAzOS05IDgtMjIgMTItNDAgMTJINzYuMzk1Yy0xNyAwLTMzIDktNDMgMjRsLTMwIDQ0Ii8+PC9nPjwvc3ZnPg==","x_price_per_wildcard_domain":"99.00","product_id":"151","price":null,"x_max_http_redirects":"0","provider_name":"cPStore","x_price_per_domain_minimum":"12","x_price_per_wildcard_domain_minimum":"99.00","description":"A domain-validated (DV) SSL certificate signed by COMODO.","price_unit":"USD","product_group":"ssl_certificate","x_price_per_wildcard_domain_maximum":"990.00","x_validation_type":"dv","billing_type":"one-time","license_term":"0","x_warn_after":"604800","max_users":null,"product_category":"N/A","base_name":"","x_payment_trigger":"issuance","x_certificate_term":["1","year"],"provider_display_name":"cPanel Store"},{"x_supports_dns_dcv":"1","product":"cPanel EV Certificate","maximum_server_price":null,"recommended":"0","icon_mime_type":"image/svg+xml","x_price_per_domain_maximum":"600","x_ssl_per_domain_pricing":"1","x_identity_verification":[{"label":"Organization Name","name":"organizationName"},{"name":"organizationalUnitName","is_optional":"1","label":"Department Name"},{"pattern":"^[0-9]{2}(?:-[0-9]{3}-[0-9]{4}|[0-9]{7})$","name":"duns_number","label":"Dun & Bradstreet D-U-N-S (Data Universal Numbering System) Number","description":"9 consecutive digits or “##-###-####” (More information (https://go.cpanel.net/get_duns))","is_optional":"1"},{"name":"streetAddress","label":"Street Address"},{"label":"City","name":"localityName"},{"name":"stateOrProvinceName","label":"State or Province"},{"name":"postalCode","label":"Postal Code"},{"label":"Country Code","name":"countryName","type":"country_code"},{"label":"Representative’s Given (First) Name","name":"rep_forename"},{"name":"rep_surname","label":"Representative’s Surname (Last Name)"},{"label":"Representative’s Email Address","name":"rep_email_address","type":"email"},{"is_optional":"1","description":"This should be one of the organization’s publicly-listed telephone numbers.","label":"Representative’s Telephone Number","type":"tel","name":"rep_telephone"},{"type":"choose_one","options":[["b","Incorporated Business (“Private Organization”)"],["d","Non-incorporated Business (“Business Entity”)"],["c","Government Entity (“Government Entity”)"]],"name":"business_category","label":"Business Category","description":"Consult the EV SSL Certificate Guidelines (https://cabforum.org/extended-validation/) for more information about this field’s options."},{"name":"joi_locality_name","is_optional":"1","label":"City Where Incorporated (JOI (Jurisdiction of Incorporation))"},{"name":"joi_state_or_province_name","label":"State or Province Where Incorporated (JOI (Jurisdiction of Incorporation))","is_optional":"1"},{"label":"Country Code Where Incorporated (JOI (Jurisdiction of Incorporation))","type":"country_code","name":"joi_country_name"},{"label":"Date of Incorporation","is_optional":"1","name":"date_of_incorporation","type":"date"},{"name":"assumed_name","label":"Assumed Name (DBA (Doing Business As))","is_optional":"1"}],"minimum_server_price":null,"x_price_per_domain":"60","enabled":"1","icon":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNTlwdCIgaGVpZ2h0PSIzMjAiIHZpZXdCb3g9IjAgMCAzNTkgMjQwIj48ZGVmcz48Y2xpcFBhdGggaWQ9ImEiPjxwYXRoIGQ9Ik0xMjMgMGgyMzUuMzd2MjQwSDEyM3ptMCAwIi8+PC9jbGlwUGF0aD48L2RlZnM+PHBhdGggZD0iTTg5LjY5IDU5LjEwMmg2Ny44MDJsLTEwLjUgNDAuMmMtMS42MDUgNS42LTQuNjA1IDEwLjEtOSAxMy41LTQuNDAyIDMuNC05LjUwNCA1LjA5Ni0xNS4zIDUuMDk2aC0zMS41Yy03LjIgMC0xMy41NSAyLjEwMi0xOS4wNSA2LjMtNS41MDUgNC4yLTkuMzUzIDkuOTA0LTExLjU1MiAxNy4xMDMtMS40IDUuNDAzLTEuNTUgMTAuNS0uNDUgMTUuMzAyIDEuMDk4IDQuNzk2IDMuMDQ3IDkuMDUgNS44NTIgMTIuNzUgMi43OTcgMy43MDMgNi40IDYuNjUyIDEwLjc5NyA4Ljg1IDQuMzk3IDIuMiA5LjE5OCAzLjI5OCAxNC40IDMuMjk4aDE5LjJjMy42MDIgMCA2LjU0NyAxLjQ1MyA4Ljg1MiA0LjM1MiAyLjI5NyAyLjkwMiAyLjk0NSA2LjE0OCAxLjk1IDkuNzVsLTEyIDQ0LjM5OGgtMjFjLTE0LjQwMyAwLTI3LjY1My0zLjE0OC0zOS43NS05LjQ1LTEyLjEwMi02LjMtMjIuMTUzLTE0LjY0OC0zMC4xNTMtMjUuMDUtOC0xMC4zOTUtMTMuNDU0LTIyLjI0Ni0xNi4zNS0zNS41NDctMi45LTEzLjMtMi41NS0yNi45NSAxLjA1Mi00MC45NTNsMS4yLTQuNWMyLjU5Ny05LjYwMiA2LjY0OC0xOC40NSAxMi4xNDgtMjYuNTUgNS41LTguMDk4IDEyLTE1IDE5LjUtMjAuNyA3LjUtNS43IDE1Ljg1LTEwLjE0OCAyNS4wNS0xMy4zNTIgOS4yLTMuMTk1IDE4Ljc5Ny00Ljc5NiAyOC44LTQuNzk2IiBmaWxsPSIjZmY2YzJjIi8+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBkPSJNMTIzLjg5IDI0MEwxODIuOTkgMTguNjAyYzEuNTk4LTUuNTk4IDQuNTk4LTEwLjA5OCA5LTEzLjVDMTk2LjM4OCAxLjcgMjAxLjQ4NCAwIDIwNy4yODggMGg2Mi43YzE0LjQwMyAwIDI3LjY1IDMuMTQ4IDM5Ljc1IDkuNDUgMTIuMTAyIDYuMyAyMi4xNTMgMTQuNjU1IDMwLjE1MyAyNS4wNSA3Ljk5NyAxMC40MDIgMTMuNSAyMi4yNTQgMTYuNSAzNS41NSAzIDEzLjMwNSAyLjU5NCAyNi45NTQtMS4yMDIgNDAuOTVsLTEuMiA0LjVjLTIuNTk3IDkuNjAyLTYuNTk3IDE4LjQ1LTEyIDI2LjU1LTUuMzk4IDguMDk4LTExLjg0NyAxNS4wNTItMTkuMzQ3IDIwLjg0OC03LjUgNS44MDUtMTUuODU1IDEwLjMwNS0yNS4wNSAxMy41LTkuMiAzLjIwNC0xOC44MDUgNC44MDUtMjguODA1IDQuODA1aC01NC4yOTdsMTAuOC00MC41YzEuNi01LjQwMiA0LjYtOS44IDktMTMuMjAzIDQuMzk2LTMuMzk4IDkuNDk3LTUuMTAyIDE1LjMwMi01LjEwMmgxNy4zOThjNy4yIDAgMTMuNjUzLTIuMiAxOS4zNTItNi41OTcgNS42OTUtNC4zOTggOS40NDUtMTAuMDk3IDExLjI1LTE3LjEgMS4zOTQtNC45OTcgMS41NDctOS45LjQ0NS0xNC43LTEuMS00LjgtMy4wNS05LjA0Ny01Ljg0OC0xMi43NS0yLjgtMy42OTUtNi40MDItNi42OTUtMTAuNzk2LTktNC40MDYtMi4yOTctOS4yMDYtMy40NS0xNC40MDItMy40NUgyMzMuMzlsLTQzLjggMTYyLjkwM2MtMS42MDYgNS40LTQuNjA2IDkuNzk3LTkgMTMuMTk1LTQuNDAzIDMuNDA3LTkuNDA2IDUuMTAyLTE1IDUuMTAyaC00MS43IiBmaWxsPSIjZmY2YzJjIi8+PC9nPjwvc3ZnPgo=","display_name":"cPanel EV SSL Certificate","requires_ip":"0","x_price_per_domain_minimum":"60","provider_name":"cPStore","price_unit":"USD","description":"An extended-validated (EV) SSL certificate signed by cPanel.","product_id":"209","x_max_http_redirects":"0","price":null,"x_payment_trigger":"checkout","max_users":null,"product_category":"N/A","base_name":"","x_certificate_term":["1","year"],"provider_display_name":"cPanel Store","product_group":"ssl_certificate","x_warn_after":"604800","x_validation_type":"ev","billing_type":"one-time","license_term":"0"}],"status":"1","errors":null,"metadata":{"transformed":"1"},"messages":null,"warnings":null},"apiversion":"3","module":"Market"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","parameters":[],"description":"This function lists all products available through all enabled cPanel Market providers.","operationId":"Market-get_all_products","summary":"Return provider's available products","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Market \\\n  get_all_products\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Market/get_all_products"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Market_get_all_products.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Market_get_all_products.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/Market/,\n    q/get_all_products/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Market_get_all_products.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Market_get_all_products.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    'Market',\n    'get_all_products'\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}"}],"tags":["Market","Market Integration"]}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"components":{"schemas":{"MarketProviderProductMetaDataType":{"discriminator":{"propertyName":"product_group","mapping":{"ssl_certificate":"#/components/schemas/SSLMarketProviderProductMetaData"}},"anyOf":[{"$ref":"#/components/schemas/MarketProviderProductMetaData"},{"$ref":"#/components/schemas/SSLMarketProviderProductMetaData"}]},"SSLMarketProviderProductMetaData":{"allOf":[{"$ref":"#/components/schemas/MarketProviderProductMetaData"},{"properties":{"x_payment_trigger":{"description":"Indicates whether the provider charges immediately or when they issue the Secure Sockets Layer (SSL) certificate.\n\n* `checkout` — Collect payment and finalize immediately after checkout. Any failures to issue the certificate must prompt a separate refund.\n* `issuance` — Collect payment when the provider issues the certificate to the user.\n\n**Note:**\n\nFor more information, read the _For certificate orders_ section of our [Guide to cPanel Market Provider Modules](https://go.cpanel.net/featureshowcasemarket) documentation.","enum":["checkout","issuance"],"type":"string"},"x_price_per_domain":{"description":"The product's price per domain.","example":"3","type":"number","minimum":"1"},"x_certificate_term":{"description":"An array that indicates the length of time and unit of time that the product secures for.","items":{"type":"string"},"example":["1","year"],"type":"array"},"x_price_per_wildcard_domain_maximum":{"minimum":"1","type":"number","example":"30","description":"The maximum `x_prive_per_wildcard_domain` value."},"x_wildcard_parent_domain_free":{"enum":["0","1"],"description":"Indicates if a wildcard domain includes its parent domain. For example, `*.example.com` would include the `example.com` parent domain.\n\n* `1` — The domain does include its parent domain.\n* `0` — The domain does **not** include its parent domain.","type":"integer"},"x_validation_type":{"type":"string","example":"ev","description":"The validation type."},"x_warn_after":{"example":"14400","description":"A length of time, in seconds, after which the cPanel interface warns the user that a problem may exist with the order. The warning suggests that they contact the cPanel Market provider's support contact.","minimum":"1","type":"integer"},"x_supports_dns_dcv":{"type":"integer","enum":["0","1"],"description":"Whether this product supports DNS-based DCV.\n* `1` — Supports DNS DCV.\n* `0` — Does `not` support DNS DCV."},"x_price_per_domain_minimum":{"minimum":"1","type":"number","example":"3","description":"The minimum `x_price_per_domain` value."},"x_price_per_domain_maximum":{"minimum":"1","type":"number","description":"The maximum `x_price_per_domain` value.","example":"30"},"x_price_per_wildcard_domain_minimum":{"minimum":"1","type":"number","description":"The minimum `x_prive_per_wildcard_domain` value.","example":"99"},"x_ssl_per_domain_pricing":{"type":"integer","description":"Whether the provider uses per-domain pricing for this certificate.\n* `1` — Uses per-domain pricing.\n* `0` — Does **not** use per-domain pricing.","enum":["0","1"]},"x_price_per_wildcard_domain":{"example":"99","description":"The price per domain for a wildcard certificate.","type":"number","minimum":"1"},"x_identity_verification":{"description":"Defines a schema for identity verification information for OV and EV certificates.","additionalProperties":{"description":"Contains additional properties that vary between products.","x-additionalPropertiesName":"certificate_properties"},"properties":{"name":{"type":"string","example":"duns_number","description":"The name of the property."},"label":{"type":"string","example":"Dun & Bradstreet D-U-N-S (Data Universal Numbering System) Number","description":"The display name of the property."}},"type":"object"},"x_max_http_redirects":{"type":"integer","minimum":"1","description":"The maximum number of HTTP redirections that the provider allows during a Domain Control Validation (DCV) check of the domain or domains in the certificate."}}}],"type":"object"},"MarketProviderProductMetaData":{"type":"object","properties":{"license_term":{"minimum":"0","type":"integer","example":"0","description":"The providers license term"},"requires_ip":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the product requires an IP address.\n* `1` — Requires an IP.\n* `0` — Does **not** require an IP."},"billing_type":{"type":"string","description":"The provider's billing type","example":"one-time"},"product_group":{"type":"string","description":"The product's group.","example":"ssl_certificate"},"display_name":{"example":"cPanel DV Certificate","description":"The product's display name.","type":"string"},"provider_display_name":{"type":"string","example":"cPStore","description":"The cPanel Market provider's display name.\n\n**Note:**\n\nThe `_DISPLAY_NAME` attribute in the cPanel Market provider module contains this value."},"icon":{"type":"string","format":"base64 image","description":"The product's display icon.","example":"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAKq2lDQ1BJQ0MgUHJvZmlsZQAASImV lgdQU+kWx7970xstAQEpoffeQUroofcmKiGhhBJiICDYEXEFVhQRacqCrjQFV6XIKiIWRFkUG/YF WRTUdbFgQ+Vd4BHee/N23rwzc3J/c+Z8/3vul++b+QNAvsfi81NgCQBSeRmCIA9nekRkFB33O8AC JUAC2kCFxU7nMwICfMDfxoe7AJp73jKY0/r7vv8akpy4dDYAUADCsZx0dirCp5DsZvMFGQCgkARq WRn8OS5HmCZABkT46BwnLHDPHMcu8O35npAgF4QnAMCTWSxBAgCk90idnslOQHTINISNeRwuD2FX hB3YiSwOwnkI66emps3xcYS1Y/9FJ+HfNGNFmixWgogXvmU+8K7cdH4KK/v/3I7/HakpwsV3qCJJ ThR4BiFPGWTPGpLTvEXMi/XzX2QuZ75/nhOFnqGLzE53iVpkDsvVe5GFyaGMRWYJltZyM5ghiyxI CxLpx6W7BYv045g+ohlS/EQcz3VnLnJOYkj4Imdyw/wWOT052Hupx0VUFwiDRDPHC9xF35iavjQb m7U0Q0ZiiOfSbBGiGThxrm6iOi9U1M/PcBZp8lMCRP1xKR6ienpmsGhtBnLAFjmJ5RWwpBMg2h/A AMEgFEk6CAOewBSYI4lMlRG3bu5MA5c0fraAm5CYQWcgtyaOzuSxDfXppsYmFgDM3cGFv/jd9fm7 BcnGLtWykPUrviNnkbBUi3gKwDGkJs9aqmluBkAaBUBbL1soyFyooed+MIAIxAENyCF3XA254wbI ZJbADjgBN+AF/EEIiASrARskglQgAFlgA9gK8kEh2A32gUpQAw6BBnAMnAAd4Aw4Dy6Da+AGuAMe ghEwDl6CKfABzEAQhIMoEBWSg5QhDUgPMoWsIQfIDfKBgqBIKAZKgHiQENoAbYMKoRKoEqqFGqFf oNPQeagfGoLuQ6PQJPQW+gKjYDJMgxVhTdgItoYZsDccAq+CE+C1cA6cB++Cy+E6+CjcDp+Hr8F3 4BH4JTyNAigSSgalgjJAWaNcUP6oKFQ8SoDahCpAlaHqUC2oLlQf6hZqBPUK9RmNRVPRdLQB2g7t iQ5Fs9Fr0ZvQRehKdAO6HX0RfQs9ip5Cf8dQMAoYPYwthomJwCRgsjD5mDLMEUwb5hLmDmYc8wGL xcpgtbBWWE9sJDYJux5bhD2AbcX2YIewY9hpHA4nh9PD2eP8cSxcBi4fV4E7ijuHu4kbx33Ck/DK eFO8Oz4Kz8Pn4svwTfhu/E38c/wMQYKgQbAl+BM4hGxCMeEwoYtwnTBOmCFKErWI9sQQYhJxK7Gc 2EK8RHxEfEcikVRJNqRAEpe0hVROOk66QholfSZLkXXJLuRospC8i1xP7iHfJ7+jUCiaFCdKFCWD sovSSLlAeUL5JEYVMxRjinHENotVibWL3RR7LU4Q1xBniK8WzxEvEz8pfl38lQRBQlPCRYIlsUmi SuK0xLDEtCRV0kTSXzJVskiySbJfckIKJ6Up5SbFkcqTOiR1QWqMiqKqUV2obOo26mHqJeo4DUvT ojFpSbRC2jHaIG1KWkraXDpMep10lfRZ6REZlIymDFMmRaZY5oTMXZkvyxSXMZbFLdu5rGXZzWUf ZZfLOsnGyRbItsrekf0iR5dzk0uW2yPXIfdYHi2vKx8onyV/UP6S/KvltOV2y9nLC5afWP5AAVbQ VQhSWK9wSGFAYVpRSdFDka9YoXhB8ZWSjJKTUpJSqVK30qQyVdlBmatcqnxO+QVdms6gp9DL6Rfp UyoKKp4qQpValUGVGVUt1VDVXNVW1cdqRDVrtXi1UrVetSl1ZXVf9Q3qzeoPNAga1hqJGvs1+jQ+ ampphmvu0OzQnNCS1WJq5Wg1az3Spmg7aq/VrtO+rYPVsdZJ1jmgc0MX1rXQTdSt0r2uB+tZ6nH1 DugN6WP0bfR5+nX6wwZkA4ZBpkGzwaihjKGPYa5hh+FrI3WjKKM9Rn1G340tjFOMDxs/NJEy8TLJ NekyeWuqa8o2rTK9bUYxczfbbNZp9sZczzzO/KD5PQuqha/FDotei2+WVpYCyxbLSSt1qxiraqth a5p1gHWR9RUbjI2zzWabMzafbS1tM2xP2P5lZ2CXbNdkN7FCa0XcisMrxuxV7Vn2tfYjDnSHGIef HEYcVRxZjnWOT53UnDhOR5yeM3QYSYyjjNfOxs4C5zbnjy62LhtdelxRrh6uBa6DblJuoW6Vbk/c Vd0T3JvdpzwsPNZ79HhiPL0993gOMxWZbGYjc8rLymuj10Vvsnewd6X3Ux9dH4FPly/s6+W71/eR n4Yfz6/DH/gz/ff6Pw7QClgb8GsgNjAgsCrwWZBJ0IagvmBq8JrgpuAPIc4hxSEPQ7VDhaG9YeJh 0WGNYR/DXcNLwkcijCI2RlyLlI/kRnZG4aLCoo5ETa90W7lv5Xi0RXR+9N1VWqvWrepfLb86ZfXZ NeJrWGtOxmBiwmOaYr6y/Fl1rOlYZmx17BTbhb2f/ZLjxCnlTMbZx5XEPY+3jy+Jn0iwT9ibMJno mFiW+Irrwq3kvknyTKpJ+pjsn1yfPJsSntKaik+NST3Nk+Il8y6mKaWtSxvi6/Hz+SNrbdfuWzsl 8BYcSYfSV6V3ZtAQszMg1BZuF45mOmRWZX7KCss6uU5yHW/dQLZu9s7s5znuOT+vR69nr+/doLJh 64bRjYyNtZugTbGbejerbc7bPL7FY0vDVuLW5K2/5RrnluS+3xa+rStPMW9L3th2j+3N+WL5gvzh HXY7an5A/8D9YXCn2c6Knd8LOAVXC40Lywq/FrGLrv5o8mP5j7O74ncNFlsWH9yN3c3bfXeP456G EsmSnJKxvb5720vppQWl7/et2ddfZl5Ws5+4X7h/pNynvLNCvWJ3xdfKxMo7Vc5VrdUK1TurPx7g HLh50OlgS41iTWHNl5+4P92r9ahtr9OsKzuEPZR56NnhsMN9P1v/3HhE/kjhkW/1vPqRhqCGi41W jY1NCk3FzXCzsHnyaPTRG8dcj3W2GLTUtsq0Fh4Hx4XHX/wS88vdE94nek9an2w5pXGquo3aVtAO tWe3T3Ukdox0RnYOnfY63dtl19X2q+Gv9WdUzlSdlT5b3E3szuuePZdzbrqH3/PqfML5sd41vQ8v RFy4fTHw4uAl70tXLrtfvtDH6Dt3xf7KmX7b/tNXra92XLO81j5gMdD2m8VvbYOWg+3Xra533rC5 0TW0Yqj7puPN87dcb12+zbx97Y7fnaG7oXfvDUcPj9zj3Ju4n3L/zYPMBzMPtzzCPCp4LPG47InC k7rfdX5vHbEcOTvqOjrwNPjpwzH22Ms/0v/4Op73jPKs7Lny88YJ04kzk+6TN16sfDH+kv9y5lX+ n5J/Vr/Wfn3qL6e/BqYipsbfCN7Mvi16J/eu/r35+97pgOknH1I/zHws+CT3qeGz9ee+L+Ffns9k fcV9Lf+m863ru/f3R7Ops7N8loA1bwUQZwDg+HgA3tYDQIkEgHoDAKLYgkeeD2jB188T+Dte8NHz YQnA4R4A5qwa0wmACoS1EKZuAWDOIiHWCDYzE+U/Iz3ezHRBiyyPWJOe2dm3swDgYgD4Njg7O1M+ O/utDBkW8dfn/Ba8+byP4QKg/g7AOjX9jXVbwH/EPwCGGQVDbR7I2wAAAAlwSFlzAAALEwAACxMB AJqcGAAAAgRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRv YmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6 cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAg PHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0 cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6 Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9u PjM5MzwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lv bj41MTU8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4x PC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRG Pgo8L3g6eG1wbWV0YT4KxfVkQAAACgpJREFUWAmNV1lvG9cZPTMcLsN9EUmJlCzJ+9oEaZAu6WIU CVD0pb+lr31x3/oL8hKgaOOiQVugRV10SZG2dlGntqPElmzZliWLEimJkkhxEfchh5ye71LMQ2Cg HXI4w5k793zL+c53R3McZ4T/Y+M4NUrTNHUcjYYYDm11brgMaLpLnTtwoPHzv7YJrPHliV/1oIyZ AA/6XTx//CmKu3nYgyH6/QEE78rrb+HC5dehiZ3jn1dN9aVrGnSZeDK5AE32ycgJeHHnJSqlAtwe E51mHceVffQ6NTTqFRQL27j1y/ewuvIZwTWMRuNoTeZ41VECKsHUD4q76HbbaszEmIlBo9FIGbeb 38CtX/wUrUZFjZs5dRr+oB8ejwfBkIlIPIFgfA4f/eG3KB3uQdd15cirgCfXxpnU4Dozl7mR29zA Pg1pt5oYjmy4XC643W410WBg4Y8fvodWs4OF8+cxlV5QwAd7GzSoBZfhQnwqBq/P5PMWnj1+gFgy icRU+gsjJg5NwCdHuW643F40jluoVmp4uvoUhttAOBJBPJHA/OIi2rVDHOS34I/GGe4an+0TzIDH 68dxowCfPwgzOMSFqxe4X8L6sw38+oMP8KMf/wTBQFBhSRplm6RT/ZH//Bg2may5NLgNLzyayUtA q9VBu9PFxtoKuod59G0X6kUJv0PiDWhkALMLZ7D29KlKkdc0MbB6+Oc//o3l53v4zpuXUC5uwz1/ bhxJTVeYr4qEIXdUroXK2gjMOgxDg1ezkMu9RK9tMRKz+Nb3vst7OnIvPsfC6TOYnklhevYUKpUq U+bmuA5e5Kr45EUZ0zE/0o/v4b33f4ZAOIZsJouZ6TTS6TRi0RiCwSCjE4DP9MEYDGzmdJzvISVB rCwVC9h8toqdwwbOz6cxf3oej5ZX0Kx38e73r2Nl6QEuXbuKuYV5HB830LcsVkUVn9+7j93NEqw3 stg/alEbdOXM/sEunj9/hkq1gS7H+v0mkskEMplpGH/501+Ryc4gNZ1CNB5HIBjA6vOXOCqUkT01 i7m5Gdy9ex+f5i28/do5FHLb8IfCrJwen5vFTn4HAf5vVOpYnI4AzTJqlQpWn72ESQ4kOGf2VAap qZTihEGC2/aQz3dRrzfg8jj6jZer63jy6Cm2clsolcowmYJTmSnYFJlINIBHT9ZhUW9WN/IIDDs4 e+40UjMM59QUmo0mfD4fRiRaMkrSuU3uHhgs0Xari4P9A2yu57C2to7t7QKqtSqEd5KGbDYDw8s8 mAG/IsnAtrWVpcfOO+98jWXEXMWGWq8/cEL+APJPt5XAtFuzrJpjlp+blRBFeiaDWrVMHYjCzYq4 du0iljfyGlPruGmEyzDg9XhVuXY7PWxsbDEdG5TxIdOja/poOCKzbQgXmH4nkghj/7CCkdvFHM84 NZaox+dHLGLira9eQIq5K1fr6Pb6NJq5TKdU5TSbTbhIrMpxE8f1uiNixLqDQzGzbVvt/MOqcCEU DmAqEUc0GnMMqUUpr5HDKmBbklotHpRx9z99xONhjJgvP6O0eO4s5skHw+OCTo8GtgVn2ACVS+V6 UKqhzxK9/MZrqLR76PVtiszYiJEzlAJTBMdQg+3YPJDwOnuBAPKrrBULpSSFKM1Gh9qew1GFHtEr h5M0qA9dhk60/rjWQP1oh2NHiJLVsWgUnY6lyOVnSvd29tCllgw5dlz/DC+Bxl1U5hjvrlQ8foO+ QwLA+9KZVJuVUtE9hkZeiEKgUathmhGYSsaVuHg8BlLRCCKJGDQaFaAU23Sk37dQKOzig5sfolNr oUxSt6kRkgZp08IJg7vIvUaBUkI0JICgy5f4TAfoTRce0+cM+n006bmb0bSsvpLqKIGlEbXqdSQS EQST5+ANVfEV3cB6bgtrlPQgQrB6HVSKh1hfXqaEAeFYCkk6kWTJx6YS5EBUDKDbdF/CI+eOhIJW WATuk5hyTdJyjVq/ub6FK1cvYo51PTs7gw7Fp16tIBHJwGHTSqcSFJsqlj7+F+KZOWbUgS8SIFVZ nlwjCJ92Xmxi7fEjoRvi3giYgtgN3lVA45XMybmUBI3SGapyqY4LFxYRCQVUiNOsFL/XgOn1KRJG kmGs3L4NG26kZ7MUFzd+/+ePkGbFdFttusCokqzs/jB8HopdmDoQhsY0koQTcN7nKWOgTuQoBsjd TqevJHeBkpyjGH3y8R0Ut/NIZrPokPHN4gGqrR5uvv9zHLCCrr97nU+BXTMArxkg+JBz0QhZxjEK 0tAGFLkheaEiMAGVhwRepUOWVSot7A0Mc4rCdO3qeaSnkySfH8lMho0miifLT3Dnb7dZuhVs7JSw VThk81pAkVXw6dIjhMMhpQVDgo+XamMMqTjBMtSv8pM3CKowxXtVtzo6vR5CpheF7T2l4abfhxBJ GI5PsVsWcO+zxziotGhMCKn5OeS2d2Dee4jM3Cmm5A4FzlLSSyw1pxIEpkKcFh+FnGqTC/JRFvAg obcZujZzGGRJFkoHVMgjyrwPJapjqXKM7fwu1pgSf8BUHbXB5mJ3W9jObamKCZF+smISLZCoisfi oEJS/7kgcUSiFA8IOhISqGGKpV1670glcHkm205+D4uLc2rxsbu7rxqRTcUrU7qbzQaOKNE7+SLe +uabFKEeTK4XRzZXEeLNiQECr7KrrjECCk9NLz8CLhvlkmSRRYZouiZPcOuzNK12F/IG0OL60SGz q/Um7t5/iFxhDy222KNGGVeunOGiZQalZlUq+gRc/JZKkBAw/yxtkWhyQCbnKMk/zyaWihBpDJ0u 5o/xWUKiYroy5JjipDkuZGen8WB5HSOOYwPE21//Bi5fPoNc3iuzcbnHfIuyjcOg4E6mU/Oy88vG S2Icj5INa0ARojeqmchVGilkabLkNOqCpEVC17O6XNWk8cMffFtx5ezZWVykXkQpPpFIiE/wjUlW 11xzDhkt6QnKzS8sUCQUwSHISZglPF0VZnlroXCI5SRjOhbHk2ebBO1DI7Es8kOiIxGZyyRx9dJp zGeTFBifCm+AxIVBIwjqD/uVECnckx8xRD66m8vwkdTcyQ0BGHL54+bEkmu+OinS+Px+VI4OsXtQ Yo/g5Lwr7BYDfaJuAR9Ljrxh5ERocly6wa6pdaE/HOH0KsQKRqBU5Hmim14vJ1LtiI46ir0Crlqo jDoZqR4y/Li/tIIBx8diIZYe1wbMsURClRkHieqVyxXcuXOfD5toNNtclh1xHOlG4k1IILQQr3Uv u5pcFJweV6w0X02osBX4eKCLQCm24pWVJ0zFBvXeBS/zyzdBjNcdLDcSRafxD6iAS9xnZuIq9/LO MM7+JPCCLhFhmoVo8no9YNlZJ8RT6jQB51idr94Wjev2LIRCEfzmd3/H9s6hYrjX64bJpiIeyLRL D5/j5q9ucd0wTTKPu6mLTkqEtBNHxRj15f//Ah9jPXoBZ9CgAAAAAElFTkSuQmCC"},"enabled":{"enum":["0","1"],"example":"1","description":"Whether the product is enabled in the cPanel Market.\n* `1` - Enabled.\n* `0` - Not enabled.","type":"integer"},"minimum_server_price":{"type":"number","example":"3","format":"currency","description":"The minimum price that the system will allow for the product.","nullable":"true"},"product_category":{"example":"N/A","description":"The product's category.","type":"string"},"base_name":{"nullable":"true","description":"The provider's base name.","type":"string"},"max_users":{"minimum":"0","type":"integer","description":"The maximum number of users.","example":"5","nullable":"true"},"price":{"format":"currency","description":"The product's price.","example":"3","nullable":"true","type":"number"},"product_id":{"type":"integer","minimum":"1","description":"The product's ID.","example":"176"},"recommended":{"description":"Whether the product is recommended.\n* `1` — We recommend the product.\n* `0` — We do not recommend the product.","example":"1","enum":["0","1"],"type":"integer"},"price_unit":{"description":"The currency code of the product's price.","format":"ISO-4217","example":"USD","type":"string"},"description":{"type":"string","description":"The product's description.","example":"An Extended Validation (EV) SLL Certificate. Browsers consider this to be more secure a domain validated (DV) certificate."},"icon_mime_type":{"format":"MIME","description":"The icon's file type.","example":"image/svg+xml","type":"string"},"provider_name":{"example":"cPStore","description":"The cPanel Market provider's name.","type":"string"},"product":{"type":"string","description":"The product name.","example":"Comodo EV Certificate"},"maximum_server_price":{"type":"number","description":"The maximum price that the system will allow for the product.","format":"currency","example":"500.1","nullable":"true"}}}},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}}},"Notifications":{"get_notifications_count":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"Notifications","description":"The Notifications module for UAPI."}],"paths":{"/Notifications/get_notifications_count":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"get_notifications_count","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"data":{"minimum":"0","type":"integer","description":"The number of server-wide notifications.","example":"3"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null}},"type":"object"},"module":{"example":"Notifications","description":"The name of the module called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 54","parameters":[],"operationId":"get_notifications_count","description":"This function returns the number of server-wide notifications on an account.","x-cpanel-api-version":"UAPI","summary":"Return server notifications total","tags":["Notifications"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Notifications \\\n  get_notifications_count\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Notifications/get_notifications_count"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Notifications_get_notifications_count.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Notifications_get_notifications_count.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/Notifications/,\n    q/get_notifications_count/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Notifications_get_notifications_count.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Notifications_get_notifications_count.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    'Notifications',\n    'get_notifications_count'\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-tagGroups":[{"tags":["Notifications"],"name":"Server Information"}],"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}}},"SubDomain":{"addsubdomain":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"tags":[{"name":"SubDomain","description":"The SubDomain module for UAPI."}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["SubDomain"],"name":"Domain Management"}],"paths":{"/SubDomain/addsubdomain":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SubDomain \\\n  addsubdomain \\\n  domain='subdomain' \\\n  rootdomain='example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SubDomain/addsubdomain?domain=subdomain&rootdomain=example.com","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SubDomain_addsubdomain.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SubDomain_addsubdomain.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/SubDomain/,\n    q/addsubdomain/,\n    {\n        'domain' => 'subdomain',\n        'rootdomain' => '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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SubDomain_addsubdomain.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SubDomain_addsubdomain.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    'SubDomain',\n    'addsubdomain',\n    array (\n        'domain' => 'subdomain',\n        'rootdomain' => '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}"}],"tags":["SubDomain"],"summary":"Create subdomain","x-cpanel-api-version":"UAPI","parameters":[{"required":"true","in":"query","name":"domain","schema":{"type":"string","example":"subdomain"},"description":"The subdomain name to create."},{"required":"true","name":"rootdomain","in":"query","schema":{"example":"example.com","format":"domain","type":"string"},"description":"The domain on which to create the new subdomain.  The domain **must** already exist on the cPanel account."},{"description":"Whether to use a canonical name (CNAME) in the [Apache® configuration for self-referential URLs](https://httpd.apache.org/docs/2.4/mod/core.html#usecanonicalname).\n* `1` - Use the CNAME.\n* `0` - Do **not** use the CNAME.","schema":{"type":"integer","default":"1","enum":["0","1"],"example":"1"},"in":"query","name":"canoff","required":"false"},{"description":"The subdomain's document `root` within the home directory, given as a valid directory path relative to the user's home directory.\n\nThis value defaults to the user's home directory `/public_html/` path.\n\n**Note:**\n\nIf the *Restrict document roots to public_html* value is set to *Off* in WHM's [*Tweak Settings*](https://go.cpanel.net/whmdocsTweakSettings#domains) interface (*WHM >> Home >> Server Configuration >> Tweak Settings*), this parameter defaults to the `/username/` path. For example, the `username` user's subdomain `example` would default to the `/home/username/example` path.","schema":{"example":"/public_html/directory_name","format":"path","type":"string"},"name":"dir","in":"query","required":"false"},{"in":"query","name":"disallowdot","required":"false","description":"Whether to remove the dot (`.`) characters from the `domain` value.\n* `1` - Remove dots from the domain.\n* `0` - Do **not** remove dots from the domain.","schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"}}],"operationId":"addsubdomain","description":"This function creates a subdomain.\n\n**Important:**\n\nWhen you disable the [Web Server role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"addsubdomain","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"SubDomain","description":"The name of the module called."},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"default":null,"nullable":"true","type":"object"}}}}}}}}},"x-cpanel-available-version":"cPanel 70"}}}}},"KnownHosts":{"update":{"paths":{"/KnownHosts/update":{"get":{"summary":"Update host in the known_hosts file","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  KnownHosts \\\n  update \\\n  host_name='host.example.com'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/KnownHosts/update?host_name=host.example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file KnownHosts_update.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/KnownHosts_update.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/KnownHosts/,\n    q/update/,\n    {\n        'host_name' => 'host.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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file KnownHosts_update.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/KnownHosts_update.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    'KnownHosts',\n    'update',\n    array (\n        'host_name' => 'host.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}"}],"tags":["KnownHosts","Known SSH Hosts Management"],"x-cpanel-available-version":"cPanel 74","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"description":"* `1` Success.\n* `0` Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"properties":{"host":{"description":"An array of objects containing the host's information.","items":{"properties":{"meta":{"properties":{"md5-printable":{"type":"string","description":"A human-readable version of the key's MD5 fingerprint.","example":"MD5:b6:03:0e:39:97:2e:d0:e7:24:ab:c3:77:3d:01:42:09"},"algorithm":{"type":"string","example":"ssh-rsa","description":"The key's algorithm."},"md5":{"type":"string","description":"The key's MD5 fingerprint.","example":"b6030e39868ed0e724cea3773e014219"},"sha256-printable":{"example":"SHA256:RPLFvPThGrW4RuWLoL9tq9I9zJ42fK3XywyRtbOz/EQ","description":"human-readable version of the key's SHA-256 fingerprint.","type":"string"},"sha256":{"type":"string","description":"The key's SHA-256 fingerprint.","example":"55a405bcf4e11ab5b846e58ba0bf6dabd23dcc9e367cae17cb0c91b5b3b3fc55"},"body":{"type":"string","example":"EEEEB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9\\bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9","description":"The host's public key."}},"type":"object","description":"An object containing metadata about the host's public key."},"host":{"oneOf":[{"type":"string","format":"hostname"},{"format":"ipv4","type":"string"}],"description":"The updated host and its associated key value.","example":"host.example.com"},"line":{"description":"The host's entry in the `/home/user/.ssh/known_hosts` file, where user is the cPanel account username. A valid entry that includes the hostname or IP address, the key's algorithm, and the public key.","example":"host.example.com ssh-rsa AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","type":"string"},"key":{"type":"string","description":"The host's key.","example":"ssh-rsa AAAAB3NzaC1yc2AEEEEDAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9"}},"type":"object"},"type":"array"}},"type":"object"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"description":"The name of the module called.","example":"KnownHosts","type":"string"},"func":{"description":"The name of the method called.","example":"update","type":"string"}}}}}}},"operationId":"KnownHosts::update","description":"This function updates a host's entry in the cPanel account's /home/user/.ssh/known_hosts file.","parameters":[{"required":"true","in":"query","name":"host_name","schema":{"oneOf":[{"format":"hostname","type":"string"},{"format":"ipv4","type":"string"}],"example":"host.example.com"},"description":"The host to update."},{"description":"The SSH port to use.","schema":{"example":"1234","default":"22","minimum":"1","maximum":"65535","type":"integer"},"in":"query","name":"port","required":"false"}]}}},"x-tagGroups":[{"name":"Security","tags":["Known SSH Hosts Management"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The KnownHosts module for UAPI.","name":"KnownHosts"},{"description":"Security / Known SSH Hosts Management","name":"Known SSH Hosts Management"}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"delete":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The KnownHosts module for UAPI.","name":"KnownHosts"},{"name":"Known SSH Hosts Management","description":"Security / Known SSH Hosts Management"}],"paths":{"/KnownHosts/delete":{"get":{"parameters":[{"description":"The hostname or IP address of the host to delete.","schema":{"example":"host.example.com","oneOf":[{"format":"hostname","type":"string"},{"format":"ipv4","type":"string"}]},"in":"query","name":"host_name","required":"true"},{"required":"false","name":"port","in":"query","schema":{"minimum":"1","type":"integer","example":"1234","default":"22"},"description":"The SSH port to use."}],"description":"This function removes a host from the cPanel account's `/home/user/.ssh/known_hosts` file.","operationId":"KnownHosts::delete","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"KnownHosts"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"data":{"type":"object","nullable":"true","default":null},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"metadata":{"properties":{}}}},"func":{"type":"string","example":"delete","description":"The name of the method called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 74","tags":["KnownHosts","Known SSH Hosts Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  KnownHosts \\\n  delete \\\n  host_name='host.example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/KnownHosts/delete?host_name=host.example.com","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file KnownHosts_delete.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/KnownHosts_delete.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/KnownHosts/,\n    q/delete/,\n    {\n        'host_name' => 'host.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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file KnownHosts_delete.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/KnownHosts_delete.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    'KnownHosts',\n    'delete',\n    array (\n        'host_name' => 'host.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}"}],"x-cpanel-api-version":"UAPI","summary":"Delete host"}}},"x-tagGroups":[{"name":"Security","tags":["Known SSH Hosts Management"]}],"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"create":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"openapi":"3.0.2","x-tagGroups":[{"tags":["Known SSH Hosts Management"],"name":"Security"}],"paths":{"/KnownHosts/create":{"get":{"x-cpanel-api-version":"UAPI","summary":"Create host","tags":["KnownHosts","Known SSH Hosts Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  KnownHosts \\\n  create \\\n  host_name='hostname.example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/KnownHosts/create?host_name=hostname.example.com","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file KnownHosts_create.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/KnownHosts_create.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/KnownHosts/,\n    q/create/,\n    {\n        'host_name' => 'hostname.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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file KnownHosts_create.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/KnownHosts_create.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    'KnownHosts',\n    'create',\n    array (\n        'host_name' => 'hostname.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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 74","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"KnownHosts","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"type":"object","properties":{"host":{"items":{"properties":{"line":{"type":"string","description":"The host's entry in the `/home/user/.ssh/known_hosts` file, where `user` is the cPanel account username.","example":"host.example.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="},"key":{"type":"string","example":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==","description":"The host's key."},"meta":{"properties":{"body":{"example":"AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==","description":"The host's public key.","type":"string"},"sha256":{"description":"The key's [SHA-256](https://en.wikipedia.org/wiki/SHA-2)\nfingerprint.","example":"44e405bcf4e11ab5b846e58ba0bf6dabd23dcc9e367cae17cb0c91b5b 3b3fc44","type":"string"},"sha256-printable":{"type":"string","description":"A human-readable version of the key's SHA-256 fingerprint.","example":"SHA256:ROQFvPThGrW4RuWLoL9tq9I9zJ42fK4XywyRtbOz/EQ"},"md5-printable":{"example":"MD5:b6:03:0e:39:97:9e:d0:e7:24:ce:a3:77:3e:01:42:09","description":"A human-readable version of the key's MD5 fingerprint.","type":"string"},"md5":{"description":"The key's [MD5](https://en.wikipedia.org/wiki/MD5) fingerprint.","example":"b6030e39979ed0e724cea3773e014209","type":"string"},"algorithm":{"example":"ssh-rsa","description":"The key's algorithm.","type":"string"}},"type":"object","description":"An object containing metadata about the host's public key."},"host":{"oneOf":[{"example":"hostname.example.com","format":"hostname","description":"A valid hostname.","type":"string"},{"type":"string","example":"192.0.2.102","format":"ipv4","description":"A valid IP address."}],"example":"hostname.example.com","description":"The hostname or IP address."}},"type":"object"},"description":"An array of objects containing information for the host.","type":"array"}}},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","example":"create","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"create","description":"This function registers a host in the cPanel account's `/home/user/.ssh/known_hosts` file.","parameters":[{"schema":{"oneOf":[{"type":"string","description":"A valid hostname.","format":"hostname","example":"hostname.example.com"},{"description":"A valid IP address.","format":"ipv4","example":"192.0.2.102","type":"string"}]},"description":"The hostname or IP address to add.","example":"hostname.example.com","required":"true","name":"host_name","in":"query"},{"description":"The SSH port to use, if the system uses a non-standard SSH port.","schema":{"example":"1234","default":"22","type":"integer"},"in":"query","name":"port","required":"false"}]}}},"tags":[{"name":"KnownHosts","description":"The KnownHosts module for UAPI."},{"description":"Security / Known SSH Hosts Management","name":"Known SSH Hosts Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}]},"verify":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"description":"The KnownHosts module for UAPI.","name":"KnownHosts"},{"description":"Security / Known SSH Hosts Management","name":"Known SSH Hosts Management"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Known SSH Hosts Management"],"name":"Security"}],"paths":{"/KnownHosts/verify":{"get":{"x-cpanel-api-version":"UAPI","summary":"Validate host","tags":["KnownHosts","Known SSH Hosts Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  KnownHosts \\\n  verify \\\n  host_name='host.example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/KnownHosts/verify?host_name=host.example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file KnownHosts_verify.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/KnownHosts_verify.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/KnownHosts/,\n    q/verify/,\n    {\n        'host_name' => 'host.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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file KnownHosts_verify.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/KnownHosts_verify.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    'KnownHosts',\n    'verify',\n    array (\n        'host_name' => 'host.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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"verify","type":"string"},"module":{"example":"KnownHosts","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"properties":{"failure_type":{"description":"The reason why the system will register the hostname.\n* `new` — The host does **not** already exist.\n* `changed` — The host's information has changed.","enum":["new","changed"],"example":"new","type":"string"},"host":{"type":"array","items":{"properties":{"key":{"example":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==","description":"The host's key.","type":"string"},"line":{"type":"string","description":"The host's entry in the `/home/user/.ssh/known_hosts` file, where `user` is the cPanel account username.","example":"host.example.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="},"host":{"oneOf":[{"type":"string","format":"ipv4"},{"type":"string","format":"domain"}],"description":"The hostname or IP address.","example":"host.example.com"},"meta":{"properties":{"md5-printable":{"description":"A human-readable version of the key's MD5 fingerprint.","example":"MD5:b6:03:0e:39:97:9e:d0:e7:24:ce:a3:77:3e:01:42:09","type":"string"},"algorithm":{"type":"string","description":"The key's algorithm.","example":"ssh-rsa"},"md5":{"type":"string","example":"b6030e39979ed0e724cea3773e014209","description":"The key's [MD5](https://en.wikipedia.org/wiki/MD5) fingerprint."},"sha256-printable":{"type":"string","example":"SHA256:ROQFvPThGrW4RuWLoL9tq9I9zJ42fK4XywyRtbOz/EQ","description":"A human-readable version of the key's SHA-256 fingerprint."},"sha256":{"description":"The key's [SHA-256](https://en.wikipedia.org/wiki/SHA-2) fingerprint.","example":"44e405bcf4e11ab5b846e58ba0bf6dabd23dcc9e367cae17cb0c91b5b3b3fc44","type":"string"},"body":{"type":"string","example":"AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==","description":"The host's public key. public key."}},"type":"object","description":"An object that contains information about the host's public key."}},"type":"object"},"description":"An array of objects that contain information about the host."},"errors":{"type":"array","description":"An array of errors that the system generated.","items":{"type":"string","example":"The example.com host does not exist in the known_hosts file."}},"status":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the host already exists in the `/home/user/.ssh/known_hosts` file, where `user` is the cPanel account username.\n* `1` — Exists.\n* `0` — The host does **not** already exist, or the system must re-register the hostname."}},"type":"object"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 74","parameters":[{"schema":{"example":"host.example.com","oneOf":[{"type":"string","format":"ipv4"},{"type":"string","format":"domain"}]},"description":"The host to query.","required":"true","in":"query","name":"host_name"},{"name":"port","in":"query","required":"false","description":"The SSH port to use.","schema":{"minimum":"1","type":"integer","maximum":"65535","default":"22","example":"1234"}}],"description":"This function checks whether a host's public key exists in the cPanel account's `/home/user/.ssh/known_hosts` file.","operationId":"verify"}}}}},"SSL":{"fetch_certificates_for_fqdns":{"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"paths":{"/SSL/fetch_certificates_for_fqdns":{"get":{"parameters":[{"in":"query","name":"domains","required":"true","style":"form","description":"A domain or comma-delimited list of domains for which to retrieve information.","examples":{"multiple":{"summary":"Multiple domains.","value":"domains=example1.com,example2.com"},"single":{"summary":"A single domain.","value":"example.com"}},"schema":{"type":"string"},"explode":"false"}],"operationId":"fetch_certificates_for_fqdns","description":"This function retrieves the certificate information for all fully qualified domain names (FQDNs) that the account owns.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"SSL","description":"The name of the module called.","type":"string"},"result":{"properties":{"data":{"items":{"type":"object","properties":{"is_self_signed":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the certificate is self-signed.\n- `1` — Self-signed.\n- `0` — Not self-signed."},"subject.commonName":{"example":"example.servername.com","format":"domain","description":"The certificate's common name.","type":"string"},"key":{"type":"string","example":"-----BEGIN RSA PRIVATE KEY-----\nMIIJJwIBAAKCAgEA4yilqsoCdEpiNOyLcPJ4FLT7vgwaLdOBeJLTMUeV2uZM4v65/tiZe7H0soDp1C55SCr3uEIEa7Lq7RUZ+F5p67BgRR19rmerKGxfN7N5Vu97pfTwW1f+lVsxUF/56lVeoAmm4okU98xJHiGGlI8ZHGJbUMYfLPy0OrA+gNwMHqMVOv1BSgpbEWCILMvnvtp0rwPutjnPVX2Dj40ia40L4Wqvp+0Yg7mZyhIOl+q6VZVIdXZslR4ZywfRBYt3ieFBDYMyNw9wN3Xy44fCpHc77+ho84W3BqrGaWSSDyf6UkZGD5mfohGf2JSp+c8J6H7hsxo7pta3K1diVXFOSfnaA+k56zW445XruwYs/SN/zvGetGi6uqhMAcVRQcYCmLCixcC6RkcUx3exxgR4q3gthDnFvWC4+NuTh8/K0BcxcuCEhRug/MfVfO3+f7RJFSJPFb9m9Lf4HHBSVkDP5WtG4XiBKCe++9Wuvxbd4QxS7YrnSopNKxkuHKswH8ONpADMYDqfLODMhNrslHNHu95Nv7AlQr8weLqMGWMp7GFqzXcl39RnVkF4Bxd3bAAsMN8/JvanMKCPjTTDrfzVFZcmHXPYOljYDdY1xfIstYVtbyFkUHZP2RPPBaPUAt90lzrKGVF8a2vdIKRiey5SZ5qu9c/mGri3oz7Lkk7qkNPAqDMCAwEAAQKCAgA3f9raG3j2CKZt381Bzzvfc0h+al6LC736Q4Ut6RuH2/S1ER9IUItPWW87nZuDp8ciBr13W0nRNmmHezxZHlgqqXEb8dSfI90Bh1jMNyFSSDihl3KSHrGotBscVBavViREXZdUicGBuXuxtkYno96yvKUq2v0K9MLkA+OBgEHFynqJaw7klBsj573dlAQO8TjI+eD8zKsHbB8Ul5rtRAy/Cl3YXWk75cDZSggevc7A0jRd3o0w8aXDoSlEfYq7OTm3n3JJWZBFPKAXTzgTDr6qItJhjS4IxXsq7RNyeIYES/8aGKKT6lJvjALrcdYt47IpHCOu447lG/h+f6xtDophLGZoAirO7lJFRVfLJh76sLF12bpXJKbbmMN+aut0nM+MLEw8A5K9OV24jJ/3+afj//5789asIyvNaQFPOX23SdLX0QbA5QWvJt2tWvvpS3ubcIJaBEMTK8asEBC68eUW0BBKJaSiYNzecUFYCBjQlxKsIrYuWZoW6fMyRel+cnqMdiH7r2p6RmgF5c9myDwq3E47jE+VrOy8uhw7EMQvT8+YSKaIbgtFZcUSU02BDRB7gWNa842m6nGs5tj5xFNQ6Wt410vilTwL+6zCQqJaKmcdE3woiIgSdrw5MssAHHjqo7QJthZfbpUAUTc6jGPNO13U1ediIRAGdQW5ALqTwQKCAQEA884bmFFZLTewHIv1PJFfNxVZfk3C7LhWE2JcI/5P/YrN4ZA8G08OYhgxqa5XnsHHQPwMM85i1HeOoPwqgTMIyLDX/Sf88+eW3ef4V2M1Y4op0ahWFEwbwXKGxOhncElObN7dfZUwVlxCReaiw2XQAGRqtQC0f+9dZysqPJr+Rz6poTiOtm7DcpW/WiGfBPvVhzBENyqouL9V3vCWYPJSLtCexECoGoPSpHKgUkwbh3+ra8SfG6FOIBj4PpMB82R7oPDjIyXF1VDfb0EwYQlKxyZoP9+NPT2MhZv/hF/Mbm/5LolVHx92hO9q6yxS6nvaFmEPr9fY1EOTWzzPOA+VyQKCAQEA7oVioaTqxENt+wHITZq100iYUpm4X1N1eENTp97QyQbQOVR/t8iGLUdvOZdIxBSTS3JFQ8TNcGDPPc+o319QGdZABNnKwFGY3Ss+5QgVeX6n0WKdxCRelUOUB174aBeXcJCKplh6xBUrLfSZxvZQQb7fv0Mb+2eKUBKTymvES1kpYdn1T0vCCHA3bVpaHuqliCoDSX3RmQICZlfSgCGBbAkmU8RuxDd9yR9l7O9MXUmLsqlsw6hvbUt+7Y13YlDtyX8gbCwEEYsoALOotY1xNfXnyZKTAXhrg+xsQLrURYZUoZiCJyK/mHCWRTPVkt89wq4IexbJ9hqlRjzpmlr8GwKCAQBxRSCs855q06SOnrehHCkQfmrFs3sMX9gdyWTllBG1yfc9BLXoOiKEkJkCLG2o5H6eQnuo1go0jBdH0+ArhnpeQ0sV4q4y4zXEgzFt6Dm1tUsYjQzxASskBQF4GkF0eZpmGmTtI5MBjHt93llgTr0EcaLh1SIHDj5m4DcPUTMyBnro3E3xlCRZ6Biu10/6EMZzuIj42Gjq7HoIyd4TzIFCHsqkgyWWrAgBPwAdPB7OJRKPTxpcy+RwJSmwaLxPSC/n5gKhIbt4D8q+9Zp0esyzGbT1d/c2rJHMwV1FMvzXkk5CwKs7enKl8FXMTRt4tXHtU8rl93JVq8+aY/YiJZuBAoIBAERG2lz7IFjeFHVtpTDRwIqilTfP2P8wnMe4PhInrgxdbu16SrUJKZ98e1I5BBNc8G0AYONtSoGItMo0z1phpkQ/GERLM8aplOB6qJ5XGg6VOuStHgwvfQOtPIp/nQvu9OK7/XRwj3Phu2KESiCyEXdAdDwDsdbdZLJXHwcqoh4Pf9EK2zW/seNIfBVJb9K5yHiZzicTZRQvhxBUw2T6MloCpH4GFM8GM3OHEV4pgeqSSvLxnLjFVmAq5EKL5Ei4cdjkExvj3aZH90N8KicOPgH8SkVhN8OL/Prein5c/LaKJV+8kEUzpTS1xc45cEGCteMsfjD97QINzpG0jgopUVECggEADIaKsx8NUQT3hm0wHRanEFJnQH5HzxaQjWbsjm2uz0KROPNIK1X5L8kypsb+EzlJtvWUqxPaOaTv4DZVpFaVzk8/2PPGsYR3mUjqMqNFYMrNwYZAXvJ/huzDPqq6+w2Pn9jcAifHNw3S8UR650v8gl7BU4fVBvhamG8JelvwLqeGWoikST9NBXVqG5IKBpUkUiFOMUNmRih9ooKvhy7GosoK8MWbmhWo1v8TTSXSagACUhAoIzb6mMN/VFC5WDbFx5AEB/G9tq/zmTqQkuo39dvgl30wyZGRNwc1aFf1Kxeven10/JN9ipp0mTa7NYSdn0RAe9ZRp5cCkgmktqmB0g==\n-----END RSA PRIVATE KEY-----","description":"The private key in Base64 PEM format.","format":"pem-private-key"},"key_algorithm":{"description":"The certificate's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"type":"string"},"serial":{"description":"The certificate's serial number.","example":"01e57e4d92","type":"string"},"verify_error":{"type":"string","description":"A message that explains the reason for a verification error.","example":"DEPTH_ZERO_SELF_SIGNED_CERT"},"modulus_length":{"minimum":"1","type":"integer","description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"2048","nullable":"true"},"id":{"example":"example_servername_com_ce52d_6e643_2813308004_119580f9b01960cjones72bc519206bc","description":"The certificate's identification.","type":"string"},"crt":{"description":"The certificate's contents in Base64 PEM format.","format":"pem-certificate","example":"-----BEGIN CERTIFICATE-----\nMIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ\nc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI\nDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy\nMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV\nBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P\nXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW\nvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da\nM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC\n+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6\nPLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj\nUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw\n+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA\nA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh\ncDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw\nFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh\n/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag\nqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa\nKm6r7YmwfLN/YMZBHXSR58oOGP9W\n-----END CERTIFICATE-----","type":"string"},"ecdsa_curve_name":{"type":"string","description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key.","example":null,"enum":["prime256v1","secp384r1"],"nullable":"true"},"modulus":{"description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"ce52db786fd2776f69057ed8ee0d8ab267a2f328a66a3afd8\n76017a99d061ec5d24d646f80ec258c696cb742e2bcd2fef920177144d9126a4\n779c1a21ca5589ff06e673556116903493100dfba385a62d11aeec57f47e5b20\nad8d1142fbe93f003fb62403cdcc0012ccd407009ac21639623bc52a5d6d3814\nff9c45a7c246799f0229b4854af2aeddfa755ab13814132424f5b1680f2c357e\n1476af7422bd5863102cfc5982b3ddad7fecdeae5c1cb73789008be9ce2f24fe\n27c9202b3bca6524ba29a30972f14cbf06f0a1b7998c2361ed90221f40829faf\n644adc7b8da6f948d8745ffbe8e5b6f0c8e7ea9ef2bc26413f90666ef1200407\neab7c3b71c6e643","nullable":"true","type":"string"},"not_after":{"type":"integer","example":"1528486286","description":"When the certificate expired.","format":"unix_timestamp"},"friendly_name":{"example":"Cert for example.servername.com","description":"The certificate's friendly name.","type":"string"},"domain_is_configured":{"enum":["0","1"],"example":"1","description":"Whether the certificate is installed on the account.\n* `1` — Installed.\n* `0` — Not installed.","type":"integer"},"signature_algorithm":{"description":"The OID of the hash algorithm used to sign the certificate request.","example":"sha256WithRSAEncryption","type":"string"},"issuer_text":{"description":"The certificate's issuer information.","example":"stateOrProvinceName\\nTX\\nlocalityName\\nHouston\\ncountryName\\nUS\\ncommonName\\nexample.com\\norganizationName\\ncPanel","type":"string"},"validation_type":{"example":"dv","description":"The certificate's validation type.\n* `ev` — Extended Validation.\n* `ov` — Organization Validated.\n* `dv` — Domain Validated.\n* `null` —  The system could not parse and determine the certificate's validation type.","type":"string"},"issuer.commonName":{"type":"string","description":"The name that issued the certificate.","example":"example.servername.com"},"ecdsa_public":{"nullable":"true","example":null,"description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an ECDSA key.","type":"string"},"not_before":{"description":"When the certificate started.","format":"unix_timestamp","example":"1496950286","type":"integer"},"created":{"type":"integer","example":"1496950287","format":"unix_timestamp","description":"When the certificate was created."},"issuer.organizationName":{"example":"Organization","description":"The certificate's organization.","type":"string"},"subject_text":{"type":"string","example":"stateOrProvinceName\\nTX\\nlocalityName\\nHouston\\ncountryName\\nUS\\ncommonName\\nexample.com\\norganizationName\\ncPanel","description":"The certificate's subject text information."},"domains":{"items":{"type":"string"},"description":"The domains that the CSR covers.","example":["example.servername.com","example.com","mail.example.com","www.example.com","www.example.servername.com"],"type":"array"},"cab":{"type":"string","example":"-----BEGIN CERTIFICATE-----\nMIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYD\nVQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJv\nb3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV\nUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU\ncnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyv\nRLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4M\nypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/5\n1KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKz\ndcZfHeFhVYAA1IFLezEPI2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWl\nIjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9Apy\nbW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY\n-----END CERTIFICATE-----","format":"pem-certificate","description":"The CA bundle's contents."}}},"type":"array"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"fetch_certificates_for_fqdns"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 66","tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  fetch_certificates_for_fqdns \\\n  domains='example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/fetch_certificates_for_fqdns?domains=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_fetch_certificates_for_fqdns.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_fetch_certificates_for_fqdns.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/SSL/,\n    q/fetch_certificates_for_fqdns/,\n    {\n        'domains' => 'example.com',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_fetch_certificates_for_fqdns.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_fetch_certificates_for_fqdns.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    'SSL',\n    'fetch_certificates_for_fqdns',\n    array (\n        'domains' => 'example.com',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return SSL certificate information for all FQDN"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"installed_host":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/SSL/installed_host":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return SSL certificate's info for dedicated IP","tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  installed_host\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/installed_host","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_installed_host.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_installed_host.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/SSL/,\n    q/installed_host/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_installed_host.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_installed_host.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    'SSL',\n    'installed_host'\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-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"installed_host"},"module":{"type":"string","description":"The name of the module called.","example":"SSL"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{}},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"properties":{"certificate":{"properties":{"subject.commonName":{"description":"The certificate's Common Name.","example":"example.com","type":"string"},"issuer.organizationName":{"example":"Organization","description":"The certificate's organization.","type":"string"},"key_algorithm":{"type":"string","description":"The certificate's key's algorithm.\n\n  * `rsaEncryption` — RSA.\n  * `id-ecPublicKey` — ECDSA.","enum":["rsaEncryption","id-ecPublicKey"],"example":"rsaEncryption"},"is_self_signed":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the certificate is self-signed.\n* `1` — Self-signed.\n* `0` — Not self-signed."},"domains":{"type":"array","description":"The domains that the certificate covers.","items":{"type":"string","format":"domain","example":"example.com"}},"subject_text":{"example":"commonName\nexample.com","description":"The X.509 information about the certificate's subject that contains CSR information.","type":"string"},"not_after":{"type":"integer","example":"1397169490","description":"The certificate's expiration time.","format":"unix_timestamp"},"verify_error":{"example":"","description":"Any errors that exist during the certificate verification process. If there are no errors, this will return an empty string.\n\n**Note:**\n\nYou **must** set the `verify_certificate` parameter to `1` for this return to appear.","type":"string"},"id":{"example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041","description":"The certificate's ID.","type":"string"},"modulus_length":{"description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"2048","nullable":"true","minimum":"1","type":"integer"},"modulus":{"type":"string","nullable":"true","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","description":"The certificate's key's modulus, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an RSA key."},"ecdsa_curve_name":{"type":"string","description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key.","example":null,"enum":["prime256v1","secp384r1"],"nullable":"true"},"signature_algorithm":{"type":"string","example":"sha256WithRSAEncryption","description":"The signature algorithm of the certificate."},"issuer_text":{"example":"commonName\nexample.com\ncountryName\nUS\nemailAddress\nusername@example.com\norganizationName\nExample\nstateOrProvinceName\nTexas\nlocalityName\nHouston","description":"The X.509 information about the issuer that contains CSR information.","type":"string"},"not_before":{"type":"integer","format":"unix_timestamp","description":"The certificate's start time.","example":"1365633490"},"validation_type":{"nullable":"true","enum":["ev","ov","dv"],"example":"dv","description":"The certificate's validation type.\n* `ev` — Extended Validation.\n* `ov` — Organization Validation.\n* `dv` — Domain Validation.\n* `null` — The system could not parse and determine the certificate's validation type.","type":"string"},"ecdsa_public":{"nullable":"true","example":null,"description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an ECDSA key.","type":"string"},"issuer.commonName":{"type":"string","example":"example.com","description":"The issuer's Common Name, typically a domain name."}},"type":"object","description":"An object containing the certificate information."},"host":{"description":"The issuer's hostname.","format":"domain","example":"example.com","type":"string"}},"type":"object"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."}},"type":"object"}},"type":"object"}}}}},"operationId":"installed_host","description":"This function retrieves information about a certificate that is installed on a domain's dedicated IP address.\n\n**Important:**\n\n  * If you do **not** possess a dedicated IP address, this function will **fail**. For non-dedicated IP addresses, use the `SSL::installed_hosts` function.\n  * When you disable the _Calendars and Contacts_, _Receive Mail_, _Web Disk_ , _Webmail_ , **and**  _Web Server_ [roles](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","parameters":[{"schema":{"type":"string","format":"domain","example":"example.com"},"description":"The domain name.\n\n**Note:**\n\nThe parameter defaults to the account's main domain.","required":"false","in":"query","name":"domain"},{"name":"verify_certificate","in":"query","required":"false","description":"Verify the certificate.\n* `1` — Verify the certificate.\n* `0` — Do **not** verify the certificate.","schema":{"type":"integer","default":"0","example":"1","enum":["0","1"]}}]}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}]},"set_autossl_excluded_domains":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/SSL/set_autossl_excluded_domains":{"get":{"summary":"Disable AutoSSL for specifed domains","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  set_autossl_excluded_domains\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/set_autossl_excluded_domains"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_set_autossl_excluded_domains.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_set_autossl_excluded_domains.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/SSL/,\n    q/set_autossl_excluded_domains/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_set_autossl_excluded_domains.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_set_autossl_excluded_domains.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    'SSL',\n    'set_autossl_excluded_domains'\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}"}],"tags":["SSL","Auto-generated SSL Certificates"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"type":"object","nullable":"true","enum":[null]},"metadata":{"properties":{}}}},"func":{"type":"string","description":"The name of the method called.","example":"set_autossl_excluded_domains"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 66","parameters":[{"required":"false","in":"query","name":"domains","schema":{"type":"string","example":"example.com,example.net"},"description":"A comma-separated list of domains for which to disable AutoSSL.\n\n**Note:**\n\nIf you do not include this parameter, the function will **enable** AutoSSL for every domain on the account."}],"description":"This function disables AutoSSL for every domain that you specify.\n\n**Warning:**\n\nThis function **replaces** the list of any domains that you previously excluded. To add domains to the list of excluded domains, use the UAPI function `SSL::add_autossl_excluded_domains`.\n\n**Important:**\n\nWhen you disable the the [Calendar and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"set_autossl_excluded_domains"}}},"x-tagGroups":[{"tags":["Auto-generated SSL Certificates"],"name":"SSL Certificates"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / Auto-generated SSL Certificates","name":"Auto-generated SSL Certificates"}]},"add_autossl_excluded_domains":{"x-tagGroups":[{"tags":["Auto-generated SSL Certificates"],"name":"SSL Certificates"}],"paths":{"/SSL/add_autossl_excluded_domains":{"get":{"summary":"Disable AutoSSL for domains","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  add_autossl_excluded_domains \\\n  domains='example.com,example2.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/add_autossl_excluded_domains?domains=example.com%2cexample2.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_add_autossl_excluded_domains.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_add_autossl_excluded_domains.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/SSL/,\n    q/add_autossl_excluded_domains/,\n    {\n        'domains' => 'example.com,example2.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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_add_autossl_excluded_domains.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_add_autossl_excluded_domains.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    'SSL',\n    'add_autossl_excluded_domains',\n    array (\n        'domains' => 'example.com,example2.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}"}],"tags":["SSL","Auto-generated SSL Certificates"],"x-cpanel-available-version":"cPanel 66","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"SSL","description":"The name of the module called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"data":{"nullable":"true","default":null,"type":"object"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{}},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"func":{"type":"string","example":"add_autossl_excluded_domains","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"add_autossl_excluded_domains","description":"This function disables AutoSSL for the domains that you specify.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"description":"A comma-separated list of domains for which to disable AutoSSL.\n\n**Note:**\n\nFor browser-based calls, use a URI encoded comma (`%2C`).","schema":{"type":"string","format":"domain","example":"example.com,example2.com"},"in":"query","name":"domains","required":"true"}]}}},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / Auto-generated SSL Certificates","name":"Auto-generated SSL Certificates"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"show_key":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}],"paths":{"/SSL/show_key":{"get":{"x-cpanel-api-version":"UAPI","summary":"Export private key","tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  show_key\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/show_key","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_show_key.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_show_key.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/SSL/,\n    q/show_key/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_show_key.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_show_key.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    'SSL',\n    'show_key'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"show_key","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"metadata":{"properties":{}},"data":{"type":"object","properties":{"text":{"example":"Private-Key: (2048 bit)\nmodulus:\n 00:b1:16:ee:3e:de:ff:41:3c:f2:cb:b5:c5:0a:3d:\n    c8:0d:64:bc:02:9f:e1:90:c9:7f:da:e8:03:e6:2c:\n 47:9f:e4:ff:5e:0d:95:64:5d:32:c2:b7:c9:01:ae:\n    30:e5:17:da:82:78:f4:15:b9:46:40:eb:8b:99:5c:\n cc:4b:e4:2a:e4:ee:0e:28:29:01:79:ee:d4:90:bc:\n    5d:9e:ab:b0:46:7c:de:4f:df:b2:d7:d1:76:89:88:\n ad:f3:6c:36:f3:a0:07:8c:90:88:19:52:0a:68:a1:\n    4d:c0:26:9e:8d:53:70:91:83:87:f4:8a:d9:b5:0f:\n a7:ed:31:f3:8f:34:d2:ca:e7:d1:31:ea:42:17:5d:\n    4d:48:7d:b3:73:07:72:40:9a:58:55:c8:b3:b6:ff:\n c2:b5:f6:ba:64:bd:3e:06:62:42:cd:44:0b:d2:f1:\n    76:5e:bb:20:55:47:d4:10:86:2d:ec:6b:e7:d2:0e:\n 5d:99:48:ca:4d:66:35:e1:1a:db:1b:96:0a:41:64:\n    aa:c4:1b:1f:9d:90:e3:2e:aa:70:61:f7:77:b6:7b:\n f7:44:22:d8:73:0b:53:84:63:c3:f4:a4:19:e2:07:\n    f6:0b:42:8a:3d:70:cb:92:24:80:44:e7:36:5d:01:\n a2:e0:e5:cd:50:e1:f7:7c:5a:9a:b5:da:c4:0f:c4:\n    73:f5\npublicExponent: 65537 (0x10001)\nprivateExponent:\n 5b:c3:ae:21:16:1c:df:09:5e:27:01:41:e1:54:b2:\n    5d:7e:5d:8e:5e:9a:dc:14:0e:14:b9:35:8c:08:55:\n f5:1d:0c:d7:07:e2:e9:e7:01:6e:b5:1d:8b:a9:5f:\n    dc:d6:c7:7b:e4:81:56:e0:72:ef:21:1f:6d:91:10:\n ac:22:c7:b7:69:44:1c:bb:62:f0:74:39:e1:e6:39:\n    fd:06:aa:89:5c:1b:36:f8:8c:0c:19:96:7b:1e:40:\n 45:6b:45:ee:68:76:80:f8:44:0e:1a:dd:19:ea:bc:\n    07:5d:fb:ba:f0:09:dc:dd:73:8d:dc:85:83:b5:61:\n 27:20:43:3d:69:f9:f0:f9:e1:73:76:29:5a:b0:05:\n    23:65:47:e8:39:f0:21:be:17:84:73:0a:08:15:4e:\n 7b:e2:14:6a:72:c7:d3:13:ff:98:ee:96:c9:40:a3:\n    d3:0d:6c:90:48:25:7c:79:74:bf:be:fa:18:62:4d:\n c9:95:d4:d9:1a:47:59:4b:98:9a:2f:95:94:f4:4e:\n    78:cc:39:ef:9f:f7:6e:eb:db:cb:e5:95:ef:8f:ee:\n 5b:bf:c7:2a:29:e5:76:16:28:53:04:8e:ef:3f:66:\n    6f:34:a1:21:09:d6:da:ac:dd:ad:8c:2e:72:78:87:\n 01:45:f2:fa:3b:b9:23:2d:cf:5f:66:dc:c7:1c:0b:\n    e1\nprime1:\n 00:e9:14:c4:18:92:16:8e:ad:fd:cf:17:f0:8c:f7:\n 55:e0:58:3d:e3:cd:bd:4d:4e:00:64:ee:f0:cf:a5:\n    b0:14:19:85:ea:03:a8:be:18:78:34:3b:04:8c:b8:\n be:9a:ee:fc:0a:3e:6f:d2:8f:8f:fd:31:2d:02:97:\n    6e:bb:18:5b:9c:6a:85:6e:25:95:a4:40:4e:0b:91:\n a1:c3:85:bd:84:0c:d5:72:34:13:12:d9:20:56:52:\n    06:53:aa:06:2d:d0:61:2b:0b:d9:94:c6:d7:62:0f:\n c9:7d:17:cc:81:39:b3:59:e5:ce:77:d5:8a:82:ab:\n    2d:37:8a:51:49:3a:aa:c7:37\nprime2:\n 00:c2:80:b7:b4:85:25:37:30:b4:45:f3:3a:69:cf:\n    c3:86:43:89:db:d4:09:6b:72:54:a6:89:b4:a7:43:\n 3c:dd:da:c6:46:89:93:0a:05:9a:8c:d6:05:5c:6a:\n    4d:34:1e:84:5b:14:28:b7:ef:d2:be:a5:10:9c:5f:\n e7:35:fb:15:e2:9e:4a:60:0a:73:01:f0:55:6c:75:\n    25:8a:9b:b0:32:d3:28:41:11:e2:85:2d:f6:35:76:\n 6c:68:14:ba:02:98:44:82:e1:c6:ca:f7:07:78:ca:\n    ff:1a:60:3a:e1:88:91:55:a1:ae:11:46:29:4b:f0:\n 0f:e0:de:8a:0d:26:91:5c:33\nexponent1:\n    1d:2a:ad:13:4a:0c:aa:94:19:43:b6:02:33:11:ac:\n 5c:63:8e:73:18:46:cd:0a:aa:bf:f6:aa:89:c1:79:\n    14:3a:d1:68:24:47:14:6a:a9:78:17:be:8d:01:7d:\n 50:94:01:54:22:d6:09:6a:4f:a1:66:6a:f4:7d:10:\n    ad:36:f2:17:d3:b8:98:bc:f9:49:d1:86:32:aa:69:\n ac:b6:ea:ad:40:91:e1:35:a5:01:61:cc:4b:20:fe:\n    8b:af:a6:10:4b:98:2d:33:d1:69:6d:ac:7c:27:ef:\n 95:c8:c9:9d:8e:23:e4:66:fe:7c:3e:6b:93:c8:69:\n    e3:1e:5a:e7:a8:00:c0:e7\nexponent2:\n 6d:2e:3b:f0:c5:5c:a2:a2:60:4f:73:bd:32:70:41:\n    dd:38:44:46:75:bb:e3:e8:85:c4:06:40:b6:33:74:\n 13:45:1f:4f:b1:22:2c:da:00:6b:56:28:24:3c:37:\n    a2:2e:0f:35:e1:17:0a:49:41:0f:6b:30:eb:d6:99:\n bf:1f:76:a5:83:1d:54:d4:08:c2:e9:d9:c9:cb:e8:\n    8a:e9:e1:fa:65:b5:8e:f1:2f:2a:7b:26:5d:d4:5f:\n fd:fc:c4:7d:78:63:dc:e4:47:e6:de:cb:fe:ee:54:\n    4c:c5:ff:c7:62:15:d2:ef:b2:fa:57:5c:0f:18:6e:\n 91:57:da:3e:8f:8b:c1:29\ncoefficient:\n    00:bd:71:a9:3c:18:7b:0c:93:ab:d5:bf:f3:be:ea:\n 35:45:86:ce:60:0f:67:b3:2d:ba:5f:cf:9f:b6:1a:\n    13:27:cb:da:e7:ad:f3:c7:c2:06:7c:9e:00:d5:6c:\n 07:74:71:2c:35:39:c9:4b:24:cc:11:fd:60:c2:a2:\n    0b:28:b9:8b:4d:48:c6:0d:f0:39:34:dc:e2:c9:3a:\n b8:c6:64:0a:17:df:c4:f1:3d:fb:18:0b:af:ed:27:\n    3f:98:3b:e1:24:72:fc:5d:af:2c:e3:b6:07:3e:e1:\n 2f:fe:db:44:b0:8b:c3:e5:72:82:e5:a4:4a:3a:37:\n    8f:c4:9f:db:e9:1c:33:6a:f3\n","description":"The raw information from the [OpenSSL](https://www.openssl.org/) command-line tool.","type":"string"},"details":{"description":"An object of the key's details.","type":"object","properties":{"ecdsa_public":{"example":null,"description":"The key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The key is **not** an ECDSA key.","nullable":"true","type":"string"},"friendly_name":{"example":"TestKey","description":"The key's friendly name.","type":"string"},"key":{"example":"-----BEGIN RSA PRIVATE KEY-----\nMIIJJwIBAAKCAgEA4yilqsoCdEpiNOyLcPJ4FLT7vgwaLdOBeJLTMUeV2uZM4v65\n/tiZe7H0soDp1C55SCr3uEIEa7Lq7RUZ+F5p67BgRR19rmerKGxfN7N5Vu97pfTw\nW1f+lVsxUF/56lVeoAmm4okU98xJHiGGlI8ZHGJbUMYfLPy0OrA+gNwMHqMVOv1B\nSgpbEWCILMvnvtp0rwPutjnPVX2Dj40ia40L4Wqvp+0Yg7mZyhIOl+q6VZVIdXZs\nlR4ZywfRBYt3ieFBDYMyNw9wN3Xy44fCpHc77+ho84W3BqrGaWSSDyf6UkZGD5mf\nohGf2JSp+c8J6H7hsxo7pta3K1diVXFOSfnaA+k56zW445XruwYs/SN/zvGetGi6\nuqhMAcVRQcYCmLCixcC6RkcUx3exxgR4q3gthDnFvWC4+NuTh8/K0BcxcuCEhRug\n/MfVfO3+f7RJFSJPFb9m9Lf4HHBSVkDP5WtG4XiBKCe++9Wuvxbd4QxS7YrnSopN\nKxkuHKswH8ONpADMYDqfLODMhNrslHNHu95Nv7AlQr8weLqMGWMp7GFqzXcl39Rn\nVkF4Bxd3bAAsMN8/JvanMKCPjTTDrfzVFZcmHXPYOljYDdY1xfIstYVtbyFkUHZP\n2RPPBaPUAt90lzrKGVF8a2vdIKRiey5SZ5qu9c/mGri3oz7Lkk7qkNPAqDMCAwEA\nAQKCAgA3f9raG3j2CKZt381Bzzvfc0h+al6LC736Q4Ut6RuH2/S1ER9IUItPWW87\nnZuDp8ciBr13W0nRNmmHezxZHlgqqXEb8dSfI90Bh1jMNyFSSDihl3KSHrGotBsc\nVBavViREXZdUicGBuXuxtkYno96yvKUq2v0K9MLkA+OBgEHFynqJaw7klBsj573d\nlAQO8TjI+eD8zKsHbB8Ul5rtRAy/Cl3YXWk75cDZSggevc7A0jRd3o0w8aXDoSlE\nfYq7OTm3n3JJWZBFPKAXTzgTDr6qItJhjS4IxXsq7RNyeIYES/8aGKKT6lJvjALr\ncdYt47IpHCOu447lG/h+f6xtDophLGZoAirO7lJFRVfLJh76sLF12bpXJKbbmMN+\naut0nM+MLEw8A5K9OV24jJ/3+afj//5789asIyvNaQFPOX23SdLX0QbA5QWvJt2t\nWvvpS3ubcIJaBEMTK8asEBC68eUW0BBKJaSiYNzecUFYCBjQlxKsIrYuWZoW6fMy\nRel+cnqMdiH7r2p6RmgF5c9myDwq3E47jE+VrOy8uhw7EMQvT8+YSKaIbgtFZcUS\nU02BDRB7gWNa842m6nGs5tj5xFNQ6Wt410vilTwL+6zCQqJaKmcdE3woiIgSdrw5\nMssAHHjqo7QJthZfbpUAUTc6jGPNO13U1ediIRAGdQW5ALqTwQKCAQEA884bmFFZ\nLTewHIv1PJFfNxVZfk3C7LhWE2JcI/5P/YrN4ZA8G08OYhgxqa5XnsHHQPwMM85i\n1HeOoPwqgTMIyLDX/Sf88+eW3ef4V2M1Y4op0ahWFEwbwXKGxOhncElObN7dfZUw\nVlxCReaiw2XQAGRqtQC0f+9dZysqPJr+Rz6poTiOtm7DcpW/WiGfBPvVhzBENyqo\nuL9V3vCWYPJSLtCexECoGoPSpHKgUkwbh3+ra8SfG6FOIBj4PpMB82R7oPDjIyXF\n1VDfb0EwYQlKxyZoP9+NPT2MhZv/hF/Mbm/5LolVHx92hO9q6yxS6nvaFmEPr9fY\n1EOTWzzPOA+VyQKCAQEA7oVioaTqxENt+wHITZq100iYUpm4X1N1eENTp97QyQbQ\nOVR/t8iGLUdvOZdIxBSTS3JFQ8TNcGDPPc+o319QGdZABNnKwFGY3Ss+5QgVeX6n\n0WKdxCRelUOUB174aBeXcJCKplh6xBUrLfSZxvZQQb7fv0Mb+2eKUBKTymvES1kp\nYdn1T0vCCHA3bVpaHuqliCoDSX3RmQICZlfSgCGBbAkmU8RuxDd9yR9l7O9MXUmL\nsqlsw6hvbUt+7Y13YlDtyX8gbCwEEYsoALOotY1xNfXnyZKTAXhrg+xsQLrURYZU\noZiCJyK/mHCWRTPVkt89wq4IexbJ9hqlRjzpmlr8GwKCAQBxRSCs855q06SOnreh\nHCkQfmrFs3sMX9gdyWTllBG1yfc9BLXoOiKEkJkCLG2o5H6eQnuo1go0jBdH0+Ar\nhnpeQ0sV4q4y4zXEgzFt6Dm1tUsYjQzxASskBQF4GkF0eZpmGmTtI5MBjHt93llg\nTr0EcaLh1SIHDj5m4DcPUTMyBnro3E3xlCRZ6Biu10/6EMZzuIj42Gjq7HoIyd4T\nzIFCHsqkgyWWrAgBPwAdPB7OJRKPTxpcy+RwJSmwaLxPSC/n5gKhIbt4D8q+9Zp0\nesyzGbT1d/c2rJHMwV1FMvzXkk5CwKs7enKl8FXMTRt4tXHtU8rl93JVq8+aY/Yi\nJZuBAoIBAERG2lz7IFjeFHVtpTDRwIqilTfP2P8wnMe4PhInrgxdbu16SrUJKZ98\ne1I5BBNc8G0AYONtSoGItMo0z1phpkQ/GERLM8aplOB6qJ5XGg6VOuStHgwvfQOt\nPIp/nQvu9OK7/XRwj3Phu2KESiCyEXdAdDwDsdbdZLJXHwcqoh4Pf9EK2zW/seNI\nfBVJb9K5yHiZzicTZRQvhxBUw2T6MloCpH4GFM8GM3OHEV4pgeqSSvLxnLjFVmAq\n5EKL5Ei4cdjkExvj3aZH90N8KicOPgH8SkVhN8OL/Prein5c/LaKJV+8kEUzpTS1\nxc45cEGCteMsfjD97QINzpG0jgopUVECggEADIaKsx8NUQT3hm0wHRanEFJnQH5H\nzxaQjWbsjm2uz0KROPNIK1X5L8kypsb+EzlJtvWUqxPaOaTv4DZVpFaVzk8/2PPG\nsYR3mUjqMqNFYMrNwYZAXvJ/huzDPqq6+w2Pn9jcAifHNw3S8UR650v8gl7BU4fV\nBvhamG8JelvwLqeGWoikST9NBXVqG5IKBpUkUiFOMUNmRih9ooKvhy7GosoK8MWb\nmhWo1v8TTSXSagACUhAoIzb6mMN/VFC5WDbFx5AEB/G9tq/zmTqQkuo39dvgl30w\nyZGRNwc1aFf1Kxeven10/JN9ipp0mTa7NYSdn0RAe9ZRp5cCkgmktqmB0g==\n-----END RSA PRIVATE KEY-----","description":"The key's contents.","format":"pem-private-key","type":"string"},"key_algorithm":{"enum":["rsaEncryption","id-ecPublicKey"],"example":"rsaEncryption","description":"The key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","type":"string"},"modulus_length":{"type":"integer","example":"2048","description":"The length, in bits, of the key's modulus.\n\n* `null` — The key is **not** an RSA key.","nullable":"true"},"id":{"example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041","description":"The key's ID.","type":"string"},"ecdsa_curve_name":{"type":"string","nullable":"true","description":"The ECDSA curve that the key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The key is **not** an ECDSA key.","example":null,"enum":["prime256v1","secp384r1"]},"created":{"type":"integer","example":"1365633415","format":"unix_timestamp","description":"The key's creation date."},"modulus":{"nullable":"true","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","description":"The key's modulus, in hexadecimal format.\n\n* `null` — The key is **not** an RSA key.","type":"string"}}}}},"status":{"type":"integer","description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"SSL"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"name":"id","in":"query","required":"false","description":"The key's ID.\n\n**Note:**\n\nYou **must** use either the `id` or the `friendly_name` parameter.","schema":{"type":"string","example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041"}},{"required":"false","name":"friendly_name","in":"query","schema":{"example":"TestKey","type":"string"},"description":"The key's friendly name.\n\n**Note:**\n\nYou **must** use either the `id` or the `friendly_name` parameter."}],"description":"This function retrieves a private key.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, **and** Web Server [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"show_key"}}},"x-tagGroups":[{"tags":["SSL Certificate Management"],"name":"SSL Certificates"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"show_csr":{"paths":{"/SSL/show_csr":{"get":{"tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  show_csr\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/show_csr"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_show_csr.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_show_csr.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/SSL/,\n    q/show_csr/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_show_csr.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_show_csr.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    'SSL',\n    'show_csr'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Export certificate signing request","parameters":[{"schema":{"example":"example_com_e095f_0ab2f_ebcbe4a571276f48562241411556647f","type":"string"},"description":"The CSR's ID.","required":"false","name":"id","in":"query"},{"description":"The CSR's friendly name.","schema":{"type":"string","example":"TestCSR"},"in":"query","name":"friendly_name","required":"false"}],"operationId":"show_csr","description":"This function retrieves a certificate signing request (CSR).\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\nand Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.\n\n**Note:**\n\nWhen you call this function, you **must** include either the `id`\nor the `friendly_name` parameter.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"show_csr","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"metadata":{"properties":{}},"data":{"properties":{"csr":{"example":"-----BEGIN CERTIFICATE REQUEST-----\nMIIC3TCCAcUCAQAwgZcxFDASBgNVBAMMC2V4YW1wbGUuY29tMRYwFAYDVQQLDA1E\nb2N1bWVudGF0aW9uMQswCQYDVQQGEwJVUzEiMCAGCSqGSIb3DQEJARYTbGF1cmVu\nY2VAY3BhbmVsLm5ldDEUMBIGA1UECgwLY1BhbmVsIEluYy4xDjAMBgNVBAgMBVRl\neGFzMRAwDgYDVQQHDAdIb3VzdG9uMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAp092NvpqyT7mg2qDqZW1XetQGeo217o9r7AOONaTrNsMgbL/d31rQzpC\nD65SPxJ/NSpovMi48tbue3A5W6+r2CN62oFk/d34N2swN1w11NTLzOfTPQgGnBe0\nCRdqNonx68l8Cwj+auRMGakqxtaESOfx0T87Ngr/1CIqUbTzU0LembWh+1VI5Djy\n2CRmRWKkSAAu7X/OJN7cfcPh7ReZc9Ha6VmzNxbutBDRcnCJVOAGMsv2Cg4mQZhg\nyMC8KF1r/ktHneDdGJdypdrmdr0qkqzMwTaYIb6M/93Yp+bswGH4oyqa4GYeTpRu\n2OOCeydxONOnYRZWfL0SnL2Gnvnd3wIDAQABoAAwDQYJKoZIhvcNAQEFBQADggEB\nAFlolzJbcviWcdZUv+PJ7G8cAqFAxa8a3W2a0Y1U0BaMrpDfuOHpQgOtO62rr+i+\nhkrIReuk7Isyl6GoZkX17KhQ1Vo9aW8a8Ur7+0RGDbxRlK9jJWnvSFn6cMMqRSfA\nDXpptxhqBFZJIZMc3pPX9Jqycuu8bxeIvUKeSMe3Jxcl1ZXEXX47FeRZxvd+WXF9\n4Xu4KZXHdzb5tB6jPhzIaN0/3d92N/KhvCcnw3YC2fEGDkpOlZaoa7O72+aq5K3b\nM1htFv9deAHqIHefV41iOrxUCIKIhdPIjvAm774lDHLzPpJVrshO/NpA74LEkny5\nFMwKKx+6Jgx1HSWucn5kWek=\n-----END CERTIFICATE REQUEST-----","description":"The CSR's text.","type":"string"},"details":{"properties":{"emailAddress":{"type":"string","example":"username@example.com","format":"email","description":"The CSR's email address."},"organizationalUnitName":{"type":"string","example":"Department","description":"The CSR's organizational unit name."},"modulus":{"nullable":"true","description":"The CSR's modulus.","example":"a74f7636fa6ac93ee6836a83a995b55deb5019ea36d7ba3dafb00e38d693acdb0c81b2ff777d6b433a420fae523f127f352a68bcc8b8f2d6ee7b70395bafabd8237ada8164fdddf8376b30375c35d4d4cbcce7d33d08069c17b409176a3689f1ebc97c0b08fe6ae44c19a92ac6d68448e7f1d13f3b360affd4222a51b4f35342de99b5a1fb5548e438f2d824664562a448002eed7fce24dedc7dc3e1ed179973d1dae959b33716eeb410d172708954e00632cbf60a0e26419860c8c0bc285d6bfe4b479de0dd189772a5dae676bd2a92acccc1369821be8cffddd8a7e6ecc061f8a32a9ae0661e4e946ed8e3827b277138d3a76116567cbd129cbd869ef9dddf","type":"string"},"id":{"description":"The CSR's ID.","example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041","type":"string"},"countryName":{"type":"string","example":"US","description":"The CSR's [ISO-3166](https://en.wikipedia.org/wiki/ISO_3166)\ncountry code."},"localityName":{"description":"The certificate's locality or city.","example":"Houston","type":"string"},"organizationName":{"type":"string","example":"Organization","description":"The CSR's organization name."},"friendly_name":{"type":"string","description":"The CSR's friendly name.","example":"TestCSR"},"stateOrProvinceName":{"type":"string","description":"The CSR's state or province name.","example":"Texas"},"key_algorithm":{"example":"rsaEncryption","description":"The key algorithm that encrypts the CSR.","type":"string"},"created":{"description":"The CSR's creation date.","format":"unix_timestamp","example":"1538265600","type":"integer"},"commonName":{"type":"string","example":"example.com","description":"The CSR's Common Name or Distinguished Name."},"domains":{"items":{"example":"example.com","type":"string"},"description":"A list of the domains that the CSR covers.","type":"array"}},"type":"object","description":"An object contaning the CSR's contents."},"text":{"type":"string","example":"Certificate Request:\n Data:\n Version: 0 (0x0)\n Subject: CN = example.com, C = US, emailAddress = username@example.com, O = Example, ST = Texas, L = Houston\n Subject Public Key Info:\n Public Key Algorithm: rsaEncryption\n Public-Key: (2048 bit)\n Modulus:\n 00:bf:44:22:cb:13:2b:7f:41:9f:48:85:d6:2c:77:\n 03:cf:84:db:90:5c:5a:ed:e5:9c:cb:d6:9d:4b:fc:\n 67:58:b7:db:71:dd:eb:8e:5a:77:6f:03:5d:96:85:\n 60:dc:91:45:59:85:ff:9e:57:76:a5:b5:cd:dc:48:\n 25:89:3f:8f:17:c1:c2:1e:4d:ec:f0:08:1a:a9:cc:\n 2d:45:34:be:82:77:a5:e4:bb:0b:82:bc:82:51:c3:\n ac:1b:ed:c3:a4:b3:e6:14:4f:ba:9e:39:af:08:ae:\n 3c:2c:15:bd:dc:03:17:93:01:95:4f:c0:2a:0f:3b:\n 46:5f:5e:6f:96:d5:b2:dd:53:22:a9:91:e4:36:8e:\n f2:60:5b:ca:b3:72:e6:be:53:8b:9e:b6:72:26:04:\n 85:37:f4:89:c1:78:91:7d:46:96:71:c4:be:39:f3:\n cc:1d:79:bc:33:61:5c:5f:76:52:4a:7d:d0:60:31:\n 79:96:44:6e:6a:77:72:70:1f:3f:08:24:e6:d1:50:\n c0:6a:86:98:df:56:8b:ae:2f:c1:97:bc:ed:4c:70:\n a1:a6:b2:7e:25:97:8f:95:73:a1:84:71:43:da:33:\n 48:d5:44:17:e1:28:1e:37:93:63:fa:ec:45:17:39:\n e5:ff:62:90:6b:b2:eb:11:5b:32:b2:ce:51:0b:8a:\n 3e:95\n Exponent: 65537 (0x10001)\n Attributes:\n a0:00\n Signature Algorithm: sha1WithRSAEncryption\n 41:bd:99:89:7a:1b:c2:71:90:f7:5a:17:05:c9:77:c8:f0:0e:\n 62:0f:85:0d:fb:16:02:74:34:5f:7a:93:3e:50:8e:cf:f4:6f:\n ee:ab:7b:c9:ef:7c:76:59:dd:85:fd:7d:4e:ac:95:9d:b7:ae:\n 8a:89:fc:1f:5b:ee:ee:6b:cd:9b:4e:2d:2a:fb:1b:32:8f:8f:\n 56:70:d1:42:c1:72:ed:04:4b:27:5a:ee:5a:e1:2b:6e:53:59:\n aa:14:25:87:7f:2b:c3:7a:f5:b2:6c:71:2a:93:62:40:ca:87:\n b4:fe:34:a1:95:77:1e:98:f1:71:5e:14:97:61:73:07:8d:bc:\n 3e:e1:f8:47:f7:00:8b:06:a5:1c:84:a3:88:9a:7b:37:74:5d:\n 34:a6:ae:22:ab:a3:b8:9f:d7:ab:60:9a:70:81:15:13:0f:d9:\n ff:ab:7a:2b:fd:cb:96:04:ad:00:6b:e4:74:4e:59:57:a5:9e:\n 84:c7:74:d8:62:08:37:b3:ee:cc:74:b2:b6:26:e8:c0:37:32:\n 19:dc:1c:ff:97:4a:cc:1c:36:c3:a7:2d:ca:77:53:c4:1d:1c:\n 3c:36:5b:f8:90:46:01:48:49:61:9b:ef:bb:b3:a8:94:0b:3f:\n 50:51:93:29:9f:aa:9a:ab:ae:3d:3c:72:8a:0b:bc:2f:3f:19:\n d7:5d:70:14\n","description":"The parsed information from the OpenSSL command-line tool."}},"type":"object"},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"}}},"module":{"type":"string","example":"SSL","description":"The name of the module called."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / SSL Certificate Management","name":"SSL Certificate Management"}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"upload_key":{"paths":{"/SSL/upload_key":{"post":{"requestBody":{"description":"The certificate's contents.","content":{"multipart/form-data":{"schema":{"properties":{"crt":{"type":"string","description":"The key's contents.","format":"pem-private-key"},"friendly_name":{"description":"The key's friendly name.","type":"string"}},"type":"object"}}}},"tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --input=json --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  upload_key\n"},{"source":"POST /cpsess##########/execute/SSL/upload_key HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 0\n\n","lang":"HTTP","label":"HTTP Request (Wire Format)"}],"x-cpanel-api-version":"UAPI","summary":"Import private key","operationId":"upload_key","description":"This function uploads a private key.\n\n**Note:**\n\nDue to the limited field length of HTTP GET method calls, you **must** use\nthe HTTP POST method. For this reason, you **cannot** use a cPanel or Webmail\nsession URL to call this function.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\n**and** Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","parameters":[{"in":"query","name":"key","required":"true","description":"The key's contents.","schema":{"type":"string","format":"pem-private-key","example":"\"-----BEGIN RSA PRIVATE KEY-----\\nMIIEowIBAAKCAQEAyeiHvMuJuVk8ZEY6wMzUS1g0eWaHaIWmIRe+Qrn6SwiRrm1p\\npsJCiGPPPQGOSg4FzrMXqE0zsi/Tk3hUO/EEsi7CcZe8cUanjlUeXhiwrb86FCMF\\nOb9siRHQvlss7VCg8ZGXXTWZgf5yD3A1xPwdayYwF2Tc7GkNcZGUAI58geuYaq+U\\nGiLczRGZep1IQ0b1cZnqDvGMx6AS6hiDqLISjnmXYY2OhG6Uyp+SuinjYzLPJ6eO\\nN/7i9qqbcGmt0ssddmhR897+bTEom5SlSuyi03KZ9Rn4ZmNJgOsup9MclSBGxBys\\nb6MuuM3N0/tF5QuwmDc8H6h2rNBP9vGV7RTTXQIDAQABAoIBAFS/WVoRRLmbjxG3\\nuKl8UA9f8oaSVnu0vUpeoOl5Dmm4Kw2/tvzbxPlii3Xb1VGYGS/tVBy8atp74J6h\\nfxm5zHLN1afAPMR/F41ShPCSBHapMUOKf4MBqhjOdYOw2Way1RsQNSxWdxxtJIr+\\nWlNYTzDOUpk/KMvCPHZS2IBzTidpcFpDQ3pyDXjOoKJJH0EQWPtvxJNGrFqmU29D\\n9WBqQemHnDrzg3s7JzQ5cGpbbCE+QX8IckNkslAkyhm771CtqWdeo+c45e6YfGcx\\nKuAy1zGSVzQBuitzYoMUOL5olXLEj8fHzXd/cZP4yCyyabcGz2vi6luxF+28l1OL\\nG1axyLECgYEA+bD5B+Y/Dp5hZ/uVR1bbvyraQpwbDesS1zgnJ53KOIl926dnWzIt\\nUvM46+c9IF+UJrtzwIB6IvjAQioNFrK36bHgNGzNf9WQ54NN172qveaFLdW34z/i\\nGR2ix/efm9OC41QREQ/5IKV07TibCwVazVBWascMPkH7FnguTvTCiosCgYEAzwJ+\\nGPlIWjK+sqkK5JMUyuH43qAvgVfkZV906JpNRQH0Mob3bC0nXN95EoTwWXk68ULT\\no1GHv9XLbj8e+Ok7kpJQZT5vEZnDN+cy3jdTLCvcjU5Q3ToImOTp9isSAFWRTbtk\\nyabLNoIIsTR/ZwwPFTZcRiK2d8k7ZhcRKdfGnrcCgYAPZ06FoTukoDqsGoYkB4S4\\n72DVmSHGIwlfg5ROylouULUV9ubWZmsLYfvR+cr4k0zlcsz6RDLEs4nQyx1RmCbm\\nYNXPBiNLTpaI4b3MoGPHIVB3+mZEu60sFXr0UR9kkpDRi18eKVkaHXrwI3zVGjh2\\n0Az0u2DS+mkOAs4AivLxbwKBgQC0XPqbLc+Bb0dCCREJmLD8GCkrZ6wcaQUB4krN\\nQ2vhnVM0Fu5K3Yi3XapynUuA2aSmgtA9MxMw7MkjlHGa9DPIgBz2KZDCaBN0iMeE\\nX/XivZCbucmxBxhohsLmjh5QFj3U2Vp2bBIQuvlx1EjQ8uvNUqDRJvuOoNFVIPH+\\nYBeZPwKBgA//kXfNtNMHOpch699i3rgTzbRFDmGwsr1otzvJsXw7Pr2bM4WIzUJy\\nG2SUSUlQRSZK4+BBKT9S0d7TynJD6X/6R7IBotZbfXs1myYxEsKj89/BQmr47x2h\\nHjYVCClNoJlsbd5C2yu1R3PikweWGoVaxE3c+AN5knqjwJ0g21Cf\\n-----END RSA PRIVATE KEY-----\""}},{"schema":{"example":"TestKey","type":"string"},"description":"The key's friendly name.","required":"false","name":"friendly_name","in":"query"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1"},"data":{"type":"array","items":{"type":"object","properties":{"modulus_length":{"example":"2048","description":"The length, in bits, of the key's modulus.\n\n* `null` — The key is **not** an RSA key.","nullable":"true","minimum":"1","type":"integer"},"id":{"type":"string","description":"The key's ID.","example":"bbe7e_16e2d_df7539f280eb1ecf6c1096190e41ada7"},"modulus":{"type":"string","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","description":"The key's modulus, in hexadecimal format.\n\n* `null` — The key is **not** an RSA key.","nullable":"true"},"created":{"type":"integer","example":"1569844800","description":"The key's creation date.","format":"unix_timestamp"},"ecdsa_curve_name":{"type":"string","description":"The ECDSA curve that the key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The key is **not** an ECDSA key.","enum":["prime256v1","secp384r1"],"example":null,"nullable":"true"},"key_algorithm":{"type":"string","enum":["rsaEncryption","id-ecPublicKey"],"example":"rsaEncryption","description":"The key’s algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA."},"friendly_name":{"description":"The key's friendly name.","example":"TestKey","type":"string"},"ecdsa_public":{"type":"string","nullable":"true","description":"The key’s ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The key is **not** an ECDSA key.","example":null}}}},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"SSL"},"func":{"example":"upload_key","description":"The name of the method called.","type":"string"}},"type":"object"}}}}}}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / SSL Certificate Management","name":"SSL Certificate Management"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"delete_key":{"paths":{"/SSL/delete_key":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"SSL","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"data":{"type":"array","items":{"properties":{"key_algorithm":{"type":"string","example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"description":"The key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA."},"modulus":{"nullable":"true","description":"The key's modulus, in hexadecimal format.\n\n* `null` — The key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","type":"string"},"ecdsa_curve_name":{"type":"string","description":"The ECDSA curve that the key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The key is **not** an ECDSA key.","example":null,"enum":["prime256v1","secp384r1"],"nullable":"true"},"created":{"format":"unix_timestamp","description":"The private key's creation date.","example":"1538308800","type":"integer"},"modulus_length":{"nullable":"true","description":"The length, in bits, of the key's modulus.\n\n* `null` — The key is **not** an RSA key.","example":"2048","type":"integer"},"ecdsa_public":{"type":"string","nullable":"true","description":"The key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The key is **not** an ECDSA key.","example":null},"friendly_name":{"type":"string","example":"TestKey","description":"The private key's friendly name."}},"type":"object"}},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}}},"func":{"type":"string","description":"The name of the method called.","example":"delete_key"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function deletes a private key.\n\n**Note:**\n\n* When you call this function, you **must** include the `id` or the `friendly_name`\nparameter.\n* To delete a certificate signing request (CSR), use the UAPI `SSL::delete_csr`\nfunction instead.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\nand Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","operationId":"delete_key","parameters":[{"description":"The private key's ID.","schema":{"type":"string","example":"example_com_e095f_0ab2f_ebcbe4a571276f48562241411556647f"},"name":"id","in":"query","required":"false"},{"description":"The private key's friendly name.","schema":{"example":"TestKey","type":"string"},"in":"query","name":"friendly_name","required":"false"}],"summary":"Delete private key","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  delete_key\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/delete_key","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_delete_key.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_delete_key.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/SSL/,\n    q/delete_key/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_delete_key.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_delete_key.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    'SSL',\n    'delete_key'\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}"}],"tags":["SSL","SSL Certificate Management"]}}},"x-tagGroups":[{"tags":["SSL Certificate Management"],"name":"SSL Certificates"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"find_csrs_for_key":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"tags":["cPanel Account SSL Management"],"name":"SSL Certificates"}],"paths":{"/SSL/find_csrs_for_key":{"get":{"summary":"Return private key's certificate signing requests","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  find_csrs_for_key\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/find_csrs_for_key"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_find_csrs_for_key.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_find_csrs_for_key.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/SSL/,\n    q/find_csrs_for_key/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_find_csrs_for_key.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_find_csrs_for_key.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    'SSL',\n    'find_csrs_for_key'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["SSL","cPanel Account SSL Management"],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"data":{"type":"array","items":{"properties":{"ecdsa_public":{"type":"string","example":null,"description":"The CSR's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The CSR's key is **not** an ECDSA key.","nullable":"true"},"commonName":{"type":"string","description":"The CSR's common name.","format":"domain","example":"example.com"},"domains":{"items":{"example":"example.com","format":"domain","type":"string"},"description":"A list of the domains that the CSR covers.","type":"array"},"friendly_name":{"type":"string","example":"TestCSR","description":"The CSR's friendly name."},"key_algorithm":{"type":"string","example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"description":"The CSR's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA."},"ecdsa_curve_name":{"description":"The ECDSA curve that the CSR's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The CSR's key is **not** an ECDSA key.","enum":["prime256v1","secp384r1"],"example":null,"nullable":"true","type":"string"},"created":{"type":"integer","example":"1538265600","description":"The date the CSR was created.","format":"unix_timestamp"},"modulus":{"type":"string","description":"The CSR's key's modulus, in hexadecimal format.\n\n* `null` — The CSR's key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","nullable":"true"},"id":{"type":"string","description":"The CSR's ID.","example":"example_com_a74f7_9dddf_2c5d1615e85db817d6b640f65335fb62"}},"type":"object"}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"}}},"module":{"type":"string","example":"SSL","description":"The name of the module called."},"func":{"example":"find_csrs_for_key","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"description":"This function retrieves certificate signing requests (CSR) for\na private key.\n\n**Note:**\n\nWhen you call this function, you **must** include either the `id`\nor the `friendly_name` parameter.","operationId":"find_csrs_for_key","parameters":[{"in":"query","name":"id","required":"false","description":"The key's ID.","schema":{"example":"example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3","type":"string"}},{"required":"false","in":"query","name":"friendly_name","schema":{"example":"TestKey","type":"string"},"description":"The key's friendly name."}]}}}},"delete_csr":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}],"paths":{"/SSL/delete_csr":{"get":{"parameters":[{"required":"false","name":"id","in":"query","schema":{"example":"example_com_e095f_0ab2f_ebcbe4a571276f48562241411556647f","type":"string"},"description":"The CSR's ID."},{"required":"false","in":"query","name":"friendly_name","schema":{"type":"string","example":"TestCSR"},"description":"The CSR's friendly name."}],"operationId":"delete_csr","description":"This function deletes a certificate signing request (CSR).\n\n**Note:**\n\n* When you call this function, you **must** include the `id` or the `friendly_name`\nparameter.\n* To delete a private key, use the UAPI `SSL::delete_key` function instead.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\nand Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"SSL","description":"The name of the module called."},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"type":"array","items":{"properties":{"ecdsa_public":{"type":"string","nullable":"true","description":"The CSR's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The CSR's key is **not** an ECDSA key.","example":null},"commonName":{"type":"string","example":"example.com","description":"The CSR's Common Name.","format":"domain"},"domains":{"items":{"example":"example.com","type":"string"},"description":"A list of the domains that the CSR covers.","type":"array"},"friendly_name":{"description":"The CSR's friendly name.","example":"TestCSR","type":"string"},"key_algorithm":{"description":"The CSR's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","enum":["rsaEncryption","id-ecPublicKey"],"example":"rsaEncryption","type":"string"},"modulus":{"type":"string","description":"The CSR's key's modulus, in hexadecimal format.\n\n* `null` — The CSR's key is **not** an RSA key.","example":"a74f7636fa6ac93ee6836a83a995b55deb5019ea36d7ba3dafb00e38d693acd\nb0c81b2ff777d6b433a420fae523f127f352a68bcc8b8f2d6ee7b70395bafab\nd8237ada8164fdddf8376b30375c35d4d4cbcce7d33d08069c17b409176a368\n9f1ebc97c0b08fe6ae44c19a92ac6d68448e7f1d13f3b360affd4222a51b4f3\n5342de99b5a1fb5548e438f2d824664562a448002eed7fce24dedc7dc3e1ed1\n79973d1dae959b33716eeb410d172708954e00632cbf60a0e26419860c8c0bc\n285d6bfe4b479de0dd189772a5dae676bd2a92acccc1369821be8cffddd8a7e\n6ecc061f8a32a9ae0661e4e946ed8e3827b277138d3a76116567cbd129cbd86\n9ef9dddf","nullable":"true"},"created":{"type":"integer","example":"1538308800","format":"unix_timestamp","description":"The CSR's creation date."},"ecdsa_curve_name":{"nullable":"true","enum":["prime256v1","secp384r1"],"example":null,"description":"The ECDSA curve that the CSR's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The CSR's key is **not** an ECDSA key.","type":"string"},"id":{"example":"example_com_e095f_0ab2f_ebcbe4a571276f48562241411556647f","description":"The CSR's ID.","type":"string"}},"type":"object"}},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}}}},"func":{"type":"string","description":"The name of the method called.","example":"delete_csr"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  delete_csr\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/delete_csr"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_delete_csr.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_delete_csr.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/SSL/,\n    q/delete_csr/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_delete_csr.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_delete_csr.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    'SSL',\n    'delete_csr'\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","summary":"Delete certificate signing request"}}}},"is_mail_sni_supported":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"name":"SSL Certificates","tags":["SNI Email Settings"]}],"paths":{"/SSL/is_mail_sni_supported":{"get":{"summary":"Return whether mail SNI is enabled","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  is_mail_sni_supported\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/is_mail_sni_supported"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_is_mail_sni_supported.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_is_mail_sni_supported.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/SSL/,\n    q/is_mail_sni_supported/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_is_mail_sni_supported.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_is_mail_sni_supported.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    'SSL',\n    'is_mail_sni_supported'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SSL","SNI Email Settings"],"x-cpanel-available-version":"cPanel 11.48","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{}},"data":{"description":"Whether the sslinstall feature is enabled.\n* `1` - Enabled.\n* `0` - Disabled.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"func":{"example":"is_mail_sni_supported","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"is_mail_sni_supported","description":"This function checks whether the sslinstall feature is enabled.\n\n**Warning:**\n\nMail SNI is always enabled.\n* Mail SNI is **not** compatible with Webmail and will **not** function for any Webmail connection. Webmail connections use the cPanel service SSL certificate.\n* Functions that enable Mail SNI succeed with a warning that Mail SNI is always enabled.\n* Functions that disable Mail SNI will fail and make no changes.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[]}}},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / SNI Email Settings","name":"SNI Email Settings"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"rebuildssldb":{"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["cPanel Account SSL Management"],"name":"SSL Certificates"}],"paths":{"/SSL/rebuildssldb":{"get":{"tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  rebuildssldb\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/rebuildssldb"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_rebuildssldb.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_rebuildssldb.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/SSL/,\n    q/rebuildssldb/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_rebuildssldb.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_rebuildssldb.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    'SSL',\n    'rebuildssldb'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Start SSL database rebuild","parameters":[],"description":"This function rebuilds the account's SSL database.","operationId":"rebuildssldb","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"rebuildssldb"},"module":{"example":"SSL","description":"The name of the module called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"data":{},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1","type":"integer"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"get_autossl_problems":{"x-tagGroups":[{"tags":["Auto-generated SSL Certificates"],"name":"SSL Certificates"}],"paths":{"/SSL/get_autossl_problems":{"get":{"description":"This function retrieves a list of domains that possess AutoSSL problems.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"get_autossl_problems","parameters":[],"x-cpanel-available-version":"cPanel 68","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_autossl_problems","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"data":{"type":"array","items":{"properties":{"time":{"type":"string","description":"When the problem occurred.","format":"ISO-8601 Date Time","example":"2018-06-07T05:30:09Z"},"domain":{"description":"The certificate's hostname.","format":"domain","example":"example.com","type":"string"},"problem":{"description":"text description of the problem.","example":"example.com contains 400 domains, which exceeds the maximum number (200) of domains allowed for the \"Sectigo\" AutoSSL provider. This system will include those 200 domains on the certificate that appear to be the website's most important. To allow AutoSSL to secure each domain, divide the 400 domains among separate websites. (The websites can all serve the same content from the same document root.)","type":"string"}},"type":"object"}},"metadata":{"properties":{}}},"type":"object"},"module":{"type":"string","example":"SSL","description":"The name of the module called."}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  get_autossl_problems\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/get_autossl_problems","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_get_autossl_problems.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_get_autossl_problems.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/SSL/,\n    q/get_autossl_problems/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_get_autossl_problems.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_get_autossl_problems.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    'SSL',\n    'get_autossl_problems'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SSL","Auto-generated SSL Certificates"],"summary":"Return domains with AutoSSL problems","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"Auto-generated SSL Certificates","description":"SSL Certificates / Auto-generated SSL Certificates"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"generate_key":{"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}],"paths":{"/SSL/generate_key":{"get":{"tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  generate_key\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/generate_key","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_generate_key.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_generate_key.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/SSL/,\n    q/generate_key/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_generate_key.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_generate_key.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    'SSL',\n    'generate_key'\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","summary":"Create private key","parameters":[{"description":"The key's type.\n\n* `system` — The system's default value.\n* `rsa-2048` — 2,408-bit RSA.\n* `rsa-4096` — 4,096-bit RSA.\n* `ecdsa-prime256v1` — ECDSA prime256v1 (\"P-256\").\n* `ecdsa-secp384r1` — ECDSA secp384r1 (\"P-384\").\n\nThis parameter defaults to the user's\n[default SSL/TLS key type](https://go.cpanel.net/cpaneldocsSSLTLS#default-ssl-tls-key-type).\n\n**Note:**\n\nIf you do **not** use this parameter, the system defaults to the `keysize` parameter's default value.","schema":{"type":"string","example":"rsa-2048","enum":["system","rsa-2048","rsa-4096","ecdsa-prime256v1","ecdsa-secp384r1"]},"name":"keytype","in":"query","required":"false"},{"schema":{"default":"2048","example":"2048","type":"integer"},"deprecated":"true","description":"The key's modulus size.\n\n**Note:**\n\nUse the `keytype` parameter.","required":"false","in":"query","name":"keysize"},{"in":"query","name":"friendly_name","required":"false","description":"A friendly name for the new key.\n\nThis parameter defaults to the key's type, creation date, and creation time.","schema":{"example":"TestKey","type":"string"}}],"operationId":"SSL-generate_key","description":"This function generates a private key.\n\n**Important:**\n\n* You **cannot** call both the `keytype` and `keysize` parameters in a single call.\n* When you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, **and**\nWeb Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"generate_key"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"properties":{"key_algorithm":{"enum":["rsaEncryption","id-ecPublicKey"],"example":"rsaEncryption","description":"The key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","type":"string"},"modulus_length":{"nullable":"true","example":"2048","description":"The length, in bits, of the key's modulus.\n\n* `null` — The key is **not** an RSA key.","type":"integer"},"id":{"type":"string","example":"example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff","description":"The key's ID."},"text":{"type":"string","example":"-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAyeiHvMuJuVk8ZEY6wMzUS1g0eWaHaIWmIRe+Qrn6SwiRrm1p\npsJCiGPPPQGOSg4FzrMXqE0zsi/Tk3hUO/EEsi7CcZe8cUanjlUeXhiwrb86FCMF\nOb9siRHQvlss7VCg8ZGXXTWZgf5yD3A1xPwdayYwF2Tc7GkNcZGUAI58geuYaq+U\nGiLczRGZep1IQ0b1cZnqDvGMx6AS6hiDqLISjnmXYY2OhG6Uyp+SuinjYzLPJ6eO\nN/7i9qqbcGmt0ssddmhR897+bTEom5SlSuyi03KZ9Rn4ZmNJgOsup9MclSBGxBys\nb6MuuM3N0/tF5QuwmDc8H6h2rNBP9vGV7RTTXQIDAQABAoIBAFS/WVoRRLmbjxG3\nuKl8UA9f8oaSVnu0vUpeoOl5Dmm4Kw2/tvzbxPlii3Xb1VGYGS/tVBy8atp74J6h\nfxm5zHLN1afAPMR/F41ShPCSBHapMUOKf4MBqhjOdYOw2Way1RsQNSxWdxxtJIr+\nWlNYTzDOUpk/KMvCPHZS2IBzTidpcFpDQ3pyDXjOoKJJH0EQWPtvxJNGrFqmU29D\n9WBqQemHnDrzg3s7JzQ5cGpbbCE+QX8IckNkslAkyhm771CtqWdeo+c45e6YfGcx\nKuAy1zGSVzQBuitzYoMUOL5olXLEj8fHzXd/cZP4yCyyabcGz2vi6luxF+28l1OL\nG1axyLECgYEA+bD5B+Y/Dp5hZ/uVR1bbvyraQpwbDesS1zgnJ53KOIl926dnWzIt\nUvM46+c9IF+UJrtzwIB6IvjAQioNFrK36bHgNGzNf9WQ54NN172qveaFLdW34z/i\nGR2ix/efm9OC41QREQ/5IKV07TibCwVazVBWascMPkH7FnguTvTCiosCgYEAzwJ+\nGPlIWjK+sqkK5JMUyuH43qAvgVfkZV906JpNRQH0Mob3bC0nXN95EoTwWXk68ULT\no1GHv9XLbj8e+Ok7kpJQZT5vEZnDN+cy3jdTLCvcjU5Q3ToImOTp9isSAFWRTbtk\nyabLNoIIsTR/ZwwPFTZcRiK2d8k7ZhcRKdfGnrcCgYAPZ06FoTukoDqsGoYkB4S4\n72DVmSHGIwlfg5ROylouULUV9ubWZmsLYfvR+cr4k0zlcsz6RDLEs4nQyx1RmCbm\nYNXPBiNLTpaI4b3MoGPHIVB3+mZEu60sFXr0UR9kkpDRi18eKVkaHXrwI3zVGjh2\n0Az0u2DS+mkOAs4AivLxbwKBgQC0XPqbLc+Bb0dCCREJmLD8GCkrZ6wcaQUB4krN\nQ2vhnVM0Fu5K3Yi3XapynUuA2aSmgtA9MxMw7MkjlHGa9DPIgBz2KZDCaBN0iMeE\nX/XivZCbucmxBxhohsLmjh5QFj3U2Vp2bBIQuvlx1EjQ8uvNUqDRJvuOoNFVIPH+\nYBeZPwKBgA//kXfNtNMHOpch699i3rgTzbRFDmGwsr1otzvJsXw7Pr2bM4WIzUJy\nG2SUSUlQRSZK4+BBKT9S0d7TynJD6X/6R7IBotZbfXs1myYxEsKj89/BQmr47x2h\nHjYVCClNoJlsbd5C2yu1R3PikweWGoVaxE3c+AN5knqjwJ0g21Cf\n-----END RSA PRIVATE KEY-----","format":"pem-private-key","description":"The key's contents."},"ecdsa_curve_name":{"nullable":"true","description":"The ECDSA curve that the key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The key is **not** an ECDSA key.","example":null,"enum":["prime256v1","secp384r1"],"type":"string"},"created":{"description":"The key's creation date.","format":"unix_timestamp","example":"1601467200","type":"integer"},"modulus":{"type":"string","description":"The key's modulus, in hexadecimal format.\n\n* `null` — The key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","nullable":"true"},"ecdsa_public":{"type":"string","nullable":"true","example":null,"description":"The key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The key is **not** an ECDSA key."},"friendly_name":{"type":"string","description":"The key's friendly name.","example":"TestKey"}},"type":"object"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the errors field for more details.","enum":["1","0"],"example":"1"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"module":{"example":"SSL","description":"The name of the module called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42"}}},"x-tagGroups":[{"tags":["SSL Certificate Management"],"name":"SSL Certificates"}]},"fetch_key_and_cabundle_for_certificate":{"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/SSL/fetch_key_and_cabundle_for_certificate":{"post":{"tags":["SSL","cPanel Account SSL Management"],"requestBody":{"description":"The certificate's contents.","content":{"multipart/form-data":{"schema":{"type":"object","properties":{"certificate":{"description":"The certificate file.","format":"pem-certificate","type":"string"}}}}}},"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --input=json --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  fetch_key_and_cabundle_for_certificate\n"},{"lang":"HTTP","label":"HTTP Request (Wire Format)","source":"POST /cpsess##########/execute/SSL/fetch_key_and_cabundle_for_certificate HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 0\n\n"}],"x-cpanel-api-version":"UAPI","summary":"Return private key and CA bundle","operationId":"fetch_key_and_cabundle_for_certificate","description":"This function extracts the private key and CA bundle information from a certificate.\n\n**Note:**\n\nDue to the limited field length of `HTTP GET` method calls, you **must** use the `HTTP POST` method. For this reason, you **cannot** use a cPanel or Webmail session URL to call this function.","parameters":[{"name":"certificate","in":"query","required":"true","description":"An SSL certificate.","schema":{"example":"-----BEGIN CERTIFICATE-----MIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQIDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYyMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNVBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3PXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fWvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/daM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGjUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3WhcDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVwFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2agqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPaKm6r7YmwfLN/YMZBHXSR58oOGP9W-----END CERTIFICATE-----","format":"pem-certificate","type":"string"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"fetch_key_and_cabundle_for_certificate","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"SSL"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"type":"object","properties":{"cab":{"type":"string","description":"The CA bundle's contents (if applicable).","format":"pem-certificate","example":"-----BEGIN CERTIFICATE-----MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJvb3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJUcnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyvRLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4MypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/51KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKzdcZfHeFhVYAA1IFLezEPI2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWlIjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9ApybW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY-----END CERTIFICATE-----"},"crt_origin":{"example":"username","format":"username","description":"The username that generated the certificate.","type":"string"},"domain":{"type":"string","description":"The domain that generated the private key.","format":"domain","example":"example.com"},"ip":{"type":"string","format":"ipv4","description":"The IP address.","example":"192.168.0.1"},"user":{"type":"string","example":"username","description":"The username that stores the private key.","format":"username"},"crt":{"format":"pem-certificate","description":"The certificate's contents.","example":"-----BEGIN CERTIFICATE-----MIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQIDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYyMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNVBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3PXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fWvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/daM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGjUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3WhcDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVwFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2agqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPaKm6r7YmwfLN/YMZBHXSR58oOGP9W-----END CERTIFICATE-----","type":"string"},"searched_users":{"type":"array","description":"The users that the system searched for certificate information.","items":{"format":"username","example":"username","type":"string"}},"statusmsg":{"type":"string","example":"ok","description":"The certificate's status."},"key_origin":{"type":"string","format":"username","description":"The username that generated the private key.","example":"username"},"key":{"type":"string","format":"pem-private-key","description":"The private key.","example":"-----BEGIN RSA PRIVATE KEY-----MIIJJwIBAAKCAgEA4yilqsoCdEpiNOyLcPJ4FLT7vgwaLdOBeJLTMUeV2uZM4v65/tiZe7H0soDp1C55SCr3uEIEa7Lq7RUZ+F5p67BgRR19rmerKGxfN7N5Vu97pfTwW1f+lVsxUF/56lVeoAmm4okU98xJHiGGlI8ZHGJbUMYfLPy0OrA+gNwMHqMVOv1BSgpbEWCILMvnvtp0rwPutjnPVX2Dj40ia40L4Wqvp+0Yg7mZyhIOl+q6VZVIdXZslR4ZywfRBYt3ieFBDYMyNw9wN3Xy44fCpHc77+ho84W3BqrGaWSSDyf6UkZGD5mfohGf2JSp+c8J6H7hsxo7pta3K1diVXFOSfnaA+k56zW445XruwYs/SN/zvGetGi6uqhMAcVRQcYCmLCixcC6RkcUx3exxgR4q3gthDnFvWC4+NuTh8/K0BcxcuCEhRug/MfVfO3+f7RJFSJPFb9m9Lf4HHBSVkDP5WtG4XiBKCe++9Wuvxbd4QxS7YrnSoKxkuHKswH8ONpADMYDqfLODMhNrslHNHu95Nv7AlQr8weLqMGWMp7GFqzXcl39RnVkF4Bxd3bAAsMN8/JvanMKCPjTTDrfzVFZcmHXPYOljYDdY1xfIstYVtbyFkUHZP2RPPBaPUAt90lzrKGVF8a2vdIKRiey5SZ5qu9c/mGri3oz7Lkk7qkNPAqDMCAwEAAQKCAgA3f9raG3j2CKZt381Bzzvfc0h+al6LC736Q4Ut6RuH2/S1ER9IUItPWW87nZuDp8ciBr13W0nRNmmHezxZHlgqqXEb8dSfI90Bh1jMNyFSSDihl3KSHrGotBscVBavViREXZdUicGBuXuxtkYno96yvKUq2v0K9MLkA+OBgEHFynqJaw7klBsj573dlAQO8TjI+eD8zKsHbB8Ul5rtRAy/Cl3YXWk75cDZSggevc7A0jRd3o0w8aXDoSlEfYq7OTm3n3JJWZBFPKAXTzgTDr6qItJhjS4IxXsq7RNyeIYES/8aGKKT6lJvjALrcdYt47IpHCOu447lG/h+f6xtDophLGZoAirO7lJFRVfLJh76sLF12bpXJKbbmMN+aut0nM+MLEw8A5K9OV24jJ/3+afj//5789asIyvNaQFPOX23SdLX0QbA5QWvJt2tWvvpS3ubcIJaBEMTK8asEBC68eUW0BBKJaSiYNzecUFYCBjQlxKsIrYuWZoW6fMyRel+cnqMdiH7r2p6RmgF5c9myDwq3E47jE+VrOy8uhw7EMQvT8+YSKaIbgtFZcUSU02BDRB7gWNa842m6nGs5tj5xFNQ6Wt410vilTwL+6zCQqJaKmcdE3woiIgSdrw5MssAHHjqo7QJthZfbpUAUTc6jGPNO13U1ediIRAGdQW5ALqTwQKCAQEA884bmFFZLTewHIv1PJFfNxVZfk3C7LhWE2JcI/5P/YrN4ZA8G08OYhgxqa5XnsHHQPwMM85i1HeOoPwqgTMIyLDX/Sf88+eW3ef4V2M1Y4op0ahWFEwbwXKGxOhncElObN7dfZUwVlxCReaiw2XQAGRqtQC0f+9dZysqPJr+Rz6poTiOtm7DcpW/WiGfBPvVhzBENyqouL9V3vCWYPJSLtCexECoGoPSpHKgUkwbh3+ra8SfG6FOIBj4PpMB82R7oPDjIyXF1VDfb0EwYQlKxyZoP9+NPT2MhZv/hF/Mbm/5LolVHx92hO9q6yxS6nvaFmEPr9fY1EOTWzzPOA+VyQKCAQEA7oVioaTqxENt+wHITZq100iYUpm4X1N1eENTp97QyQbQOVR/t8iGLUdvOZdIxBSTS3JFQ8TNcGDPPc+o319QGdZABNnKwFGY3Ss+5QgVeX6n0WKdxCRelUOUB174aBeXcJCKplh6xBUrLfSZxvZQQb7fv0Mb+2eKUBKTymvES1kpYdn1T0vCCHA3bVpaHuqliCoDSX3RmQICZlfSgCGBbAkmU8RuxDd9yR9l7O9MXUmLsqlsw6hvbUt+7Y13YlDtyX8gbCwEEYsoALOotY1xNfXnyZKTAXhrg+xsQLrURYZUoZiCJyK/mHCWRTPVkt89wq4IexbJ9hqlRjzpmlr8GwKCAQBxRSCs855q06SOnrehHCkQfmrFs3sMX9gdyWTllBG1yfc9BLXoOiKEkJkCLG2o5H6eQnuo1go0jBdH0+ArhnpeQ0sV4q4y4zXEgzFt6Dm1tUsYjQzxASskBQF4GkF0eZpmGmTtI5MBjHt93llgTr0EcaLh1SIHDj5m4DcPUTMyBnro3E3xlCRZ6Biu10/6EMZzuIj42Gjq7HoIyd4TzIFCHsqkgyWWrAgBPwAdPB7OJRKPTxpcy+RwJSmwaLxPSC/n5gKhIbt4D8q+9Zp0esyzGbT1d/c2rJHMwV1FMvzXkk5CwKs7enKl8FXMTRt4tXHtU8rl93JVq8+aY/YiJZuBAoIBAERG2lz7IFjeFHVtpTDRwIqilTfP2P8wnMe4PhInrgxdbu16SrUJKZ98e1I5BBNc8G0AYONtSoGItMo0z1phpkQ/GERLM8aplOB6qJ5XGg6VOuStHgwvfQOtPIp/nQvu9OK7/XRwj3Phu2KESiCyEXdAdDwDsdbdZLJXHwcqoh4Pf9EK2zW/seNIfBVJb9K5yHiZzicTZRQvhxBUw2T6MloCpH4GFM8GM3OHEV4pgeqSSvLxnLjFVmAq5EKL5Ei4cdjkExvj3aZH90N8KicOPgH8SkVhN8OL/Prein5c/LaKJV+8kEUzpTS1xc45cEGCteMsfjD97QINzpG0jgopUVECggEADIaKsx8NUQT3hm0wHRanEFJnQH5HzxaQjWbsjm2uz0KROPNIK1X5L8kypsb+EzlJtvWUqxPaOaTv4DZVpFaVzk8/2PPGsYR3mUjqMqNFYMrNwYZAXvJ/huzDPqq6+w2Pn9jcAifHNw3S8UR650v8gl7BU4fVBvhamG8JelvwLqeGWoikST9NBXVqG5IKBpUkUiFOMUNmRih9ooKvhy7GosoK8MWbmhWo1v8TTSXSagACUhAoIzb6mMN/VFC5WDbFx5AEB/G9tq/zmTqQkuo39dvgl30wyZGRNwc1aFf1Kxeven10/JN9ipp0mTa7NYSdn0RAe9ZRp5cCkgmktqmB0g==-----END RSA PRIVATE KEY-----"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the certificate is active.\n* `1` - Active.\n* `0` - Inactive."}}},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}}}}}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}]},"get_autossl_renewal_status":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"Auto-generated SSL Certificates","description":"SSL Certificates / Auto-generated SSL Certificates"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"x-tagGroups":[{"tags":["Auto-generated SSL Certificates"],"name":"SSL Certificates"}],"paths":{"/SSL/get_autossl_renewal_status":{"get":{"parameters":[{"schema":{"type":"string","example":"example.com"},"description":"The fully qualified domain name to check.","required":"true","in":"query","name":"domain"}],"description":"This function returns the AutoSSL renewal status for a domain. It indicates whether AutoSSL is active, the domain is excluded, the domain has DCV problems, and whether the certificate will auto-renew.","operationId":"get_autossl_renewal_status","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_autossl_renewal_status","type":"string"},"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"data":{"description":"An object that contains the AutoSSL renewal status for the domain.","type":"object","properties":{"is_excluded":{"type":"integer","description":"Whether the domain is on the user's AutoSSL exclusion list.","enum":["0","1"],"example":"0"},"has_problems":{"description":"Whether AutoSSL has DCV failures recorded for this domain. Defaults to 1 if the problems database is unreachable.","enum":["0","1"],"example":"0","type":"integer"},"will_renew":{"enum":["0","1"],"example":"1","description":"Whether AutoSSL will auto-renew the certificate for this domain. Only true when the server has an active AutoSSL provider, the current certificate was issued by that provider, the domain is not excluded, and there are no recorded DCV problems.","type":"integer"},"is_active":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether an AutoSSL provider is configured on the server."}}},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"SSL","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 134","tags":["SSL","Auto-generated SSL Certificates"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  get_autossl_renewal_status \\\n  domain=example.com\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/get_autossl_renewal_status?domain=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_get_autossl_renewal_status.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_get_autossl_renewal_status.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/SSL/,\n    q/get_autossl_renewal_status/,\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\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_get_autossl_renewal_status.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_get_autossl_renewal_status.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    'SSL',\n    'get_autossl_renewal_status',\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\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","summary":"Return AutoSSL renewal status for a domain"}}}},"list_keys":{"openapi":"3.0.2","info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}],"paths":{"/SSL/list_keys":{"get":{"description":"This function lists an account's private keys.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\nand Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","operationId":"list_keys","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"data":{"items":{"type":"object","properties":{"friendly_name":{"type":"string","description":"The key's friendly name.","example":"TestKey"},"ecdsa_public":{"nullable":"true","example":null,"description":"The key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The key is **not** an ECDSA key.","type":"string"},"id":{"type":"string","example":"b116e_473f5_ad6b3bd9517fb157830d0e37a03bc596","description":"The key ID."},"modulus_length":{"nullable":"true","description":"The length, in bits, of the key's modulus.\n\n* `null` — The key is **not** an RSA key.","example":"2048","type":"integer","minimum":"1"},"created":{"example":"1569844800","format":"unix_timestamp","description":"The key's creation date.","type":"integer"},"ecdsa_curve_name":{"nullable":"true","description":"The ECDSA curve that the key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The key is **not** an ECDSA key.","enum":["prime256v1","secp384r1"],"example":null,"type":"string"},"modulus":{"nullable":"true","description":"The key's modulus, in hexadecimal format.\n\n* `null` — The key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","type":"string"},"key_algorithm":{"type":"string","example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"description":"The key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA."}}},"type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}}},"type":"object"},"func":{"type":"string","example":"list_keys","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  list_keys\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/list_keys","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_list_keys.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_list_keys.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/SSL/,\n    q/list_keys/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_list_keys.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_list_keys.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    'SSL',\n    'list_keys'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return all private keys"}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}]},"is_autossl_check_in_progress":{"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / Auto-generated SSL Certificates","name":"Auto-generated SSL Certificates"}],"paths":{"/SSL/is_autossl_check_in_progress":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"example":"1","enum":["0","1"],"description":"Whether the `autossl_check` task is in progress for the current user.\n* `1` - In progress.\n* `0` - **Not** currently in progress.","type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}},"type":"object"},"func":{"type":"string","example":"is_autossl_check_in_progress","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 68","parameters":[],"operationId":"is_autossl_check_in_progress","description":"This function verifies whether the `autossl_check` task is in progress for the current user.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function.","x-cpanel-api-version":"UAPI","summary":"Return whether AutoSSL check in progress","tags":["SSL","Auto-generated SSL Certificates"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  is_autossl_check_in_progress\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/is_autossl_check_in_progress","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_is_autossl_check_in_progress.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_is_autossl_check_in_progress.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/SSL/,\n    q/is_autossl_check_in_progress/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_is_autossl_check_in_progress.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_is_autossl_check_in_progress.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    'SSL',\n    'is_autossl_check_in_progress'\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["Auto-generated SSL Certificates"]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"disable_mail_sni":{"x-tagGroups":[{"name":"SSL Certificates","tags":["SNI Email Settings"]}],"paths":{"/SSL/disable_mail_sni":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  disable_mail_sni \\\n  domains='example.com|example1.com|example2.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/disable_mail_sni?domains=example.com%7cexample1.com%7cexample2.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_disable_mail_sni.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_disable_mail_sni.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/SSL/,\n    q/disable_mail_sni/,\n    {\n        'domains' => 'example.com|example1.com|example2.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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_disable_mail_sni.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_disable_mail_sni.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    'SSL',\n    'disable_mail_sni',\n    array (\n        'domains' => 'example.com|example1.com|example2.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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SSL","SNI Email Settings"],"summary":"Disable SNI mail services for domain","x-cpanel-api-version":"UAPI","parameters":[{"schema":{"example":"example.com|example1.com|example2.com","type":"string"},"description":"A pipe-delimited list of the account's domains.","required":"true","name":"domains","in":"query"}],"description":"This function disables SNI mail services on the specified domains.\n\n**Note:**\n\n  Mail SNI is **always** enabled.\n\n  * After you change the SNI status, you **must** run UAPI's `rebuild_mail_sni_config` function.\n  * Functions that enable Mail SNI succeed with a warning that Mail SNI is always enabled.\n  * Functions that disable Mail SNI fail and make no changes.","operationId":"disable_mail_sni","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"disable_mail_sni"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"example":{"updated_domains":{"example1.com":"1","example.com":"1"},"failed_domains":{"example2.com":"Sorry, example2.com is not one of the domains on your account."}},"properties":{"failed_domains":{"type":"object","additionalProperties":{"description":"The reason the domain failed to disable SNI.\n\n**Note:**\n\n The domain name is the return name.","type":"string"},"description":"An object containing the domains that failed to disable\n mail SNI."},"updated_domains":{"description":"AN object containing the domains with disabled mail SNI.","type":"object","additionalProperties":{"type":"integer","enum":["0","1"],"description":"Whether the domain's SNI is disabled.\n\n* `1` - Disabled.\n* `0` - Not disabled.\n\n**Note:**\n\nThe domain name is the return name."}}},"type":"object"},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings\n describe non-critical failures or other problematic conditions\n noted while running a API.","example":null}}},"module":{"type":"string","example":"SSL","description":"The name of the module called."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.48"}}},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / SNI Email Settings","name":"SNI Email Settings"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"install_ssl":{"paths":{"/SSL/install_ssl":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"install_ssl","description":"The name of the method called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"data":{"type":"object","properties":{"user":{"format":"username","description":"The domain's owner.","example":"example","type":"string"},"key_id":{"description":"The key ID.","example":"bbe7e_16e2d_df7539f280eb1ecf6c1096190e41ada7","type":"string"},"statusmsg":{"example":"The SSL certificate is now installed onto the domain \"example.com\" using the IP address \"192.168.0.1\".\nThe existing virtual host was updated with the new certificate.\nApache is restarting in the background.\nThe SSL certificate is now installed onto the domain \"example.com\" using the IP address \"192.168.0.1\".\nThe existing virtual host was updated with the new certificate.\nApache is restarting in the background","description":"The results.","type":"string"},"domain":{"type":"string","format":"domain","description":"The domain that the certificate covers.","example":"example.com"},"ip":{"oneOf":[{"type":"string","format":"ipv4"},{"format":"ipv6","type":"string"}],"example":"192.168.0.1","description":"The domain's IP address."},"action":{"description":"The action that the function used to install the certificate.","example":"update","type":"string"},"message":{"description":"The results, in text format.","example":"The SSL certificate is now installed onto the domain \"example.com\" using the IP address \"192.168.0.1\".\nThe existing virtual host was updated with the new certificate.\nApache is restarting in the background.","type":"string"},"warning_domains":{"items":{"example":"warning.com","format":"domain","type":"string"},"description":"The domains that the certificate does not cover.","type":"array"},"working_domains":{"items":{"type":"string","example":"example.com","format":"domain"},"description":"The domains that the certificate covers.","type":"array"},"cert_id":{"type":"string","description":"The certificate ID.","example":"example_com_bbe7e_16e2d_1369007999_1d87a0cdb540f5aae607b10e9a1a82fb"},"extra_certificate_domains":{"items":{"example":"ssl.example.com","format":"domain","type":"string"},"description":"The domains that require extra certificates for mail and other services.","type":"array"},"html":{"example":"The SSL certificate is now installed onto the domain \"example.com\" using the IP address \"192.168.0.1\".\nThe existing virtual host was updated with the new certificate. Apache is restarting in the background.","description":"The results, in HTML format.","type":"string"}}},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}}},"type":"object"},"module":{"type":"string","example":"SSL","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"install_ssl","description":"This function installs an SSL certificate.\n\n**Note:**\n\nDue to their inherent complexities, SSL-related functions often present problems for third-party developers. For the additional steps required to successfully call this function, read our [Call UAPI's SSL::install_ssl Function in Custom Code](https://go.cpanel.net/tutorial-call-uapis-ssl-install-ssl-function-in-custom-code) documentation.\n\n**Important:**\n\nWhen you disable the *Calendars and Contacts*, *Receive Mail*, *Web Disk*, *Webmail*, and *Web Server* [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"in":"query","name":"domain","required":"true","description":"The domain name.","schema":{"type":"string","format":"domain","example":"example.com"}},{"description":"The certificate to install.\n\n**Note:**\n\n* You **must** URI-encode this value.\n* You can use a Perl command to URI-encode your SSL certificate for this parameter.\nFor example, you can use the following string, where `CERT.FILE` is the SSL certificate file:\n\n  ```$(perl -MURI::Escape -ne 'print uri_escape($_);' CERT.FILE)```","schema":{"type":"string","example":"-----BEGIN%20CERTIFICATE-----%0AMIIEEzCCAvugAwIBAgIJALF%2FjFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD%0AVQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD%0AVQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l%0AdDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH%0AEwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU%0ABgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ%0ABgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu%0AbmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOMAwGA1UECBMFVGV4YXMxEDAOBgNV%0ABAcTB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRO0AP%0AN5XtjDqkEyJ6ctfYqUtt9yUXyRuCETFjW6opNLSmZSHeF6L2aZka646lhj02CFyl%0AkzsNSxysN66tY%2BWZcTmvgPisJdQFpFvjroJZgDjYRV0QqokKdRy%2F5BU0%2BtHXoYpj%0A9JOQlbvEWxiGR3R80sL1ma4AfSE6Gv8M%2FPULTadan51eHaikXqjOXdPJQKuWP3g9%0AFnIuf38WRYwzGrre88qsZrpsMrADX5dotHWgqAf7Tap6xfA4CUAgQo9tldariuVi%0ABz%2BsRJ%2FSjgxnhw1HYWGttBuBZFhMpdHpPnTJ7DIFMd%2FFN5gG%2Ftah30SapWpo35Ux%0A3BpJcdUjtazy82K5AgMBAAGjUDBOMB0GA1UdDgQWBBQAlv7%2FtALOYb7zAXbYG2%2B9%0AAMI3xjAfBgNVHSMEGDAWgBQAlv7%2FtALOYb7zAXbYG2%2B9AMI3xjAMBgNVHRMEBTAD%0AAQH%2FMA0GCSqGSIb3DQEBBQUAA4IBAQCxzpe71Hc7Es0dqIN7bhIFYIIgcr6wxM6a%0Aa9d%2BQG%2BQPH0x0KAqV8EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr%0AHRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw%0AcaRtXn4uc%2Bt6HYuW7yWesBauCWnJNiKbjN%2FF%2BuCTurN3QMAeWf3ZJtsfkAgk8dyq%0AR%2F83a3kDtSPrpt%2BjX%2BqdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P%2FAAGc%2B%0AZUhYoWcRWKw%2Fy6gI7Ru%2B%2B9%2B8%2BwkadL9EbKMZxhVwD5qVm4ZlWK2a%5Cr%5Cn%0A-----END%20CERTIFICATE-----","format":"pem-certificate"},"name":"cert","in":"query","required":"true"},{"description":"The certificate's key.\n\n**Note:**\n\n* You **must** URI-encode this value.\n* You can use a Perl command to URI-encode your SSL certificate for this parameter.\nFor example, you can use the following string, where `KEY.FILE` is the SSL certificate file:\n\n  ```$(perl -MURI::Escape -ne 'print uri_escape($_);' KEY.FILE)```","schema":{"type":"string","format":"pem-private-key","example":"-----BEGIN%20RSA%20PRIVATE%20KEY-----%0AMIIEpAIBAAKCAQEA4AVM6J4Qg3DIFWr%2FeJ5GRmIATYsJIepKbrDy70sq%2BudcO8R8%0Axxak0oMZ%2F9mUdpjSNK%2FfLVTuCO0kxTfQ9VUWJllX7ThD6Zh9ZvlC%2Fnf%2FOEZLm3Zb%0ABgu8rbC8E9wuDOkKbJLnINgdhtowIydLK2MJ%2B%2Bq62bFV89jkHWTMcKyyqHENo3h%0Ac%2Blkpd9vnp8rZTinaVb7nX26uQqAFZYRo%2BWU0G%2FNPsq40QVSMoqPxyEz4qXo0hvu%0AIlCXmzFZq%2F6fCVPEKPLhQgMmpdBkMz4dVOazREfqXdjMD2%2BQXSNiA1AwWr8l0r4r%0AtzlxEYDJIR41yXp0xMl3KoolxMyvLBqZy32niQIDAQABAoIBAQCmbGmhWmPsMeoC%0At1WJFxQgD4goE0U6k%2BKt7vjbOt14Pk6v%2FB2yjaju1wSGpO59WLS4%2FXrwI2se6IXr%0Amba7u3VUEgWXLriNHoLy7%2FSMNTs%2BZEKhAMG36eNe3tVdT7busTag31r6sEMGGwCs%0AIwpU%2Bazosk0oylWLEX%2Fm%2FuHWEs1eaIEWWWtgHB%2BKZrrP7Rr9RYfVQ144DxmOxS3C%0Aa9%2BmST62WqAVPR6POWGEfZqnZl%2FePWZPcQYbFrhwnnefNoYBl%2FbnLZBo8rbNWxAq%0AOEOuKfkrBzglKG%2F39WKPw8rj4JIVzY0yOuFCW6xCDWRkOrhU8Ol%2F3FvwDa3uJpkp%0AmgPr4TgxAoGBAPGPLmxSuOYR97mDAXxrs037F2GCbqWvI6m7%2FezWe9yn%2BbMpjSIW%0Afsgtq4FsyqzPueEkDdQWi3xh6nu2WI%2F1Tl875opGAqEIJMqss%2Fu11tnva5wzu1cC%0AL6H85A5%2BHMOBvP3sm6CObKcVw92h7kxynVIUJJWhjfeZMN8gBFFpKIVFAoGBAO1p%0AtXBmXLC%2FYKKvtHI3M16%2FZopvM8ZqU2HcAHaw214Refw9JJ%2Fe3%2FxTNfSerVTyCAQO%0A1AdWTzJKBN8jmSYv1Mk1D3RpQPNR7wVzi46KR081AU41uMpqIGVOwHtyVnW%2FZfLr%0Ac1DLIK8Cx8aHfoxffwzoMO5SEQSooeZfOLhsfDN1AoGBAKQTUEINsj%2B75psgbAr6%0AELGgItJ9yPBLVRr%2BcUzEpx9LDWVvjMihpP4NX1gq8EOPWT%2BewLHVmmsjCyV6xw8J%0AXXF8e2xif3in0m3D%2FwCzE7u2T06rKM3B017hKnrZmGoHnrqPU2osM4sOUpshWX6d%0Av1Q4EF1%2BfbK3YCW%2BVpCBsB9NAoGAQo%2BuhNLODee56iKkzpjXWCsFTq6ar3hD5F3P%0A63buKdNwhd2GlSPhXFbf%2B7M5GWW6BZk6rMvv7EOAVice2uvyFm8%2F4%2F1WbmF8R%2BT7%0ALX1rPLO5p%2Fm701QpvP11TabiwqRkqtSEQhSRF0AKTojSW%2FyyHCZFAawUhV%2FZ9EKi%0AHmKb97kCgYAyzmFc2it0HqnsOnRybop603nqMtWGTQO4cxa93HUDpYajuK2K3Dfr%0AxUj6lG3z%2FoKJGGE2JqgZ6LBAhNJtJWJu2ox3pKGE63QjLJnVwb8y1NFYpe%2FcrbLe%0APuBwIR0L7drXxfv7O5btY7h6QI2d1%2FUIAQPAWbxLoTM%2BndQ%2FuPEdfA%3D%3D%0A-----END%20RSA%20PRIVATE%20KEY-----"},"name":"key","in":"query","required":"true"},{"required":"false","name":"cabundle","in":"query","schema":{"example":"-----BEGIN%20CERTIFICATE-----%0AMIIB%2BjCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYD%0AVQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJv%0Ab3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV%0AUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU%0AcnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k%2B625h8cXyv%0ARLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz%2BiCWaEVh43KRuH6X4M%0AypqfpX%2F1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt%2F5%0A1KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKz%0AdcZfHeFhVYAA1IFLezEPI2PnPfMD%2BfQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWl%0AIjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4%2F5ODFlitppK%2BULdjG%2BBqXH%2F9Apy%0AbW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY%0A-----END%20CERTIFICATE-----","format":"pem-certificate","type":"string"},"description":"The Certificate Authority (CA) bundle data, if the certificate requires it.\n\n**Note:**\n\n* You **must** URI-encode this value.\n* You can use a Perl command to URI-encode your SSL certificate for this parameter.\nFor example, you can use the following string, where `CABUNDLE.FILE` is the SSL certificate file:\n\n  ```$(perl -MURI::Escape -ne 'print uri_escape($_);' CABUNDLE.FILE)```"}],"x-cpanel-api-version":"UAPI","summary":"Install SSL certificate","tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty --user=username SSL install_ssl domain='example.com' cert='-----BEGIN%20CERTIFICATE-----%0AMIIEEzCCAvugAwIBAgIJALF%2FjFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD%0AVQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD%0AVQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l%0AdDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH%0AEwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU%0ABgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ%0ABgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu%0AbmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOMAwGA1UECBMFVGV4YXMxEDAOBgNV%0ABAcTB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRO0AP%0AN5XtjDqkEyJ6ctfYqUtt9yUXyRuCETFjW6opNLSmZSHeF6L2aZka646lhj02CFyl%0AkzsNSxysN66tY%2BWZcTmvgPisJdQFpFvjroJZgDjYRV0QqokKdRy%2F5BU0%2BtHXoYpj%0A9JOQlbvEWxiGR3R80sL1ma4AfSE6Gv8M%2FPULTadan51eHaikXqjOXdPJQKuWP3g9%0AFnIuf38WRYwzGrre88qsZrpsMrADX5dotHWgqAf7Tap6xfA4CUAgQo9tldariuVi%0ABz%2BsRJ%2FSjgxnhw1HYWGttBuBZFhMpdHpPnTJ7DIFMd%2FFN5gG%2Ftah30SapWpo35Ux%0A3BpJcdUjtazy82K5AgMBAAGjUDBOMB0GA1UdDgQWBBQAlv7%2FtALOYb7zAXbYG2%2B9%0AAMI3xjAfBgNVHSMEGDAWgBQAlv7%2FtALOYb7zAXbYG2%2B9AMI3xjAMBgNVHRMEBTAD%0AAQH%2FMA0GCSqGSIb3DQEBBQUAA4IBAQCxzpe71Hc7Es0dqIN7bhIFYIIgcr6wxM6a%0Aa9d%2BQG%2BQPH0x0KAqV8EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr%0AHRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw%0AcaRtXn4uc%2Bt6HYuW7yWesBauCWnJNiKbjN%2FF%2BuCTurN3QMAeWf3ZJtsfkAgk8dyq%0AR%2F83a3kDtSPrpt%2BjX%2BqdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P%2FAAGc%2B%0AZUhYoWcRWKw%2Fy6gI7Ru%2B%2B9%2B8%2BwkadL9EbKMZxhVwD5qVm4ZlWK2a%5Cr%5Cn%0A-----END%20CERTIFICATE-----' key='-----BEGIN%20RSA%20PRIVATE%20KEY-----%0AMIIEpAIBAAKCAQEA4AVM6J4Qg3DIFWr%2FeJ5GRmIATYsJIepKbrDy70sq%2BudcO8R8%0Axxak0oMZ%2F9mUdpjSNK%2FfLVTuCO0kxTfQ9VUWJllX7ThD6Zh9ZvlC%2Fnf%2FOEZLm3Zb%0ABgu8rbC8E9wuDOkKbJLnINgdhtowIydLK2MJ%2B%2Bq62bFV89jkHWTMcKyyqHENo3h%0Ac%2Blkpd9vnp8rZTinaVb7nX26uQqAFZYRo%2BWU0G%2FNPsq40QVSMoqPxyEz4qXo0hvu%0AIlCXmzFZq%2F6fCVPEKPLhQgMmpdBkMz4dVOazREfqXdjMD2%2BQXSNiA1AwWr8l0r4r%0AtzlxEYDJIR41yXp0xMl3KoolxMyvLBqZy32niQIDAQABAoIBAQCmbGmhWmPsMeoC%0At1WJFxQgD4goE0U6k%2BKt7vjbOt14Pk6v%2FB2yjaju1wSGpO59WLS4%2FXrwI2se6IXr%0Amba7u3VUEgWXLriNHoLy7%2FSMNTs%2BZEKhAMG36eNe3tVdT7busTag31r6sEMGGwCs%0AIwpU%2Bazosk0oylWLEX%2Fm%2FuHWEs1eaIEWWWtgHB%2BKZrrP7Rr9RYfVQ144DxmOxS3C%0Aa9%2BmST62WqAVPR6POWGEfZqnZl%2FePWZPcQYbFrhwnnefNoYBl%2FbnLZBo8rbNWxAq%0AOEOuKfkrBzglKG%2F39WKPw8rj4JIVzY0yOuFCW6xCDWRkOrhU8Ol%2F3FvwDa3uJpkp%0AmgPr4TgxAoGBAPGPLmxSuOYR97mDAXxrs037F2GCbqWvI6m7%2FezWe9yn%2BbMpjSIW%0Afsgtq4FsyqzPueEkDdQWi3xh6nu2WI%2F1Tl875opGAqEIJMqss%2Fu11tnva5wzu1cC%0AL6H85A5%2BHMOBvP3sm6CObKcVw92h7kxynVIUJJWhjfeZMN8gBFFpKIVFAoGBAO1p%0AtXBmXLC%2FYKKvtHI3M16%2FZopvM8ZqU2HcAHaw214Refw9JJ%2Fe3%2FxTNfSerVTyCAQO%0A1AdWTzJKBN8jmSYv1Mk1D3RpQPNR7wVzi46KR081AU41uMpqIGVOwHtyVnW%2FZfLr%0Ac1DLIK8Cx8aHfoxffwzoMO5SEQSooeZfOLhsfDN1AoGBAKQTUEINsj%2B75psgbAr6%0AELGgItJ9yPBLVRr%2BcUzEpx9LDWVvjMihpP4NX1gq8EOPWT%2BewLHVmmsjCyV6xw8J%0AXXF8e2xif3in0m3D%2FwCzE7u2T06rKM3B017hKnrZmGoHnrqPU2osM4sOUpshWX6d%0Av1Q4EF1%2BfbK3YCW%2BVpCBsB9NAoGAQo%2BuhNLODee56iKkzpjXWCsFTq6ar3hD5F3P%0A63buKdNwhd2GlSPhXFbf%2B7M5GWW6BZk6rMvv7EOAVice2uvyFm8%2F4%2F1WbmF8R%2BT7%0ALX1rPLO5p%2Fm701QpvP11TabiwqRkqtSEQhSRF0AKTojSW%2FyyHCZFAawUhV%2FZ9EKi%0AHmKb97kCgYAyzmFc2it0HqnsOnRybop603nqMtWGTQO4cxa93HUDpYajuK2K3Dfr%0AxUj6lG3z%2FoKJGGE2JqgZ6LBAhNJtJWJu2ox3pKGE63QjLJnVwb8y1NFYpe%2FcrbLe%0APuBwIR0L7drXxfv7O5btY7h6QI2d1%2FUIAQPAWbxLoTM%2BndQ%2FuPEdfA%3D%3D%0A-----END%20RSA%20PRIVATE%20KEY-----'","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/install_ssl?domain=example.com&cert=-----BEGIN%20CERTIFICATE-----%0aMIIEEzCCAvugAwIBAgIJALF%2fjFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD%0aVQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD%0aVQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l%0adDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH%0aEwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU%0aBgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ%0aBgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu%0abmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOMAwGA1UECBMFVGV4YXMxEDAOBgNV%0aBAcTB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRO0AP%0aN5XtjDqkEyJ6ctfYqUtt9yUXyRuCETFjW6opNLSmZSHeF6L2aZka646lhj02CFyl%0akzsNSxysN66tY%2bWZcTmvgPisJdQFpFvjroJZgDjYRV0QqokKdRy%2f5BU0%2btHXoYpj%0a9JOQlbvEWxiGR3R80sL1ma4AfSE6Gv8M%2fPULTadan51eHaikXqjOXdPJQKuWP3g9%0aFnIuf38WRYwzGrre88qsZrpsMrADX5dotHWgqAf7Tap6xfA4CUAgQo9tldariuVi%0aBz%2bsRJ%2fSjgxnhw1HYWGttBuBZFhMpdHpPnTJ7DIFMd%2fFN5gG%2ftah30SapWpo35Ux%0a3BpJcdUjtazy82K5AgMBAAGjUDBOMB0GA1UdDgQWBBQAlv7%2ftALOYb7zAXbYG2%2b9%0aAMI3xjAfBgNVHSMEGDAWgBQAlv7%2ftALOYb7zAXbYG2%2b9AMI3xjAMBgNVHRMEBTAD%0aAQH%2fMA0GCSqGSIb3DQEBBQUAA4IBAQCxzpe71Hc7Es0dqIN7bhIFYIIgcr6wxM6a%0aa9d%2bQG%2bQPH0x0KAqV8EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr%0aHRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw%0acaRtXn4uc%2bt6HYuW7yWesBauCWnJNiKbjN%2fF%2buCTurN3QMAeWf3ZJtsfkAgk8dyq%0aR%2f83a3kDtSPrpt%2bjX%2bqdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P%2fAAGc%2b%0aZUhYoWcRWKw%2fy6gI7Ru%2b%2b9%2b8%2bwkadL9EbKMZxhVwD5qVm4ZlWK2a%5cr%5cn%0a-----END%20CERTIFICATE-----&key=-----BEGIN%20RSA%20PRIVATE%20KEY-----%0aMIIEpAIBAAKCAQEA4AVM6J4Qg3DIFWr%2feJ5GRmIATYsJIepKbrDy70sq%2budcO8R8%0axxak0oMZ%2f9mUdpjSNK%2ffLVTuCO0kxTfQ9VUWJllX7ThD6Zh9ZvlC%2fnf%2fOEZLm3Zb%0aBgu8rbC8E9wuDOkKbJLnINgdhtowIydLK2MJ%2b%2bq62bFV89jkHWTMcKyyqHENo3h%0ac%2blkpd9vnp8rZTinaVb7nX26uQqAFZYRo%2bWU0G%2fNPsq40QVSMoqPxyEz4qXo0hvu%0aIlCXmzFZq%2f6fCVPEKPLhQgMmpdBkMz4dVOazREfqXdjMD2%2bQXSNiA1AwWr8l0r4r%0atzlxEYDJIR41yXp0xMl3KoolxMyvLBqZy32niQIDAQABAoIBAQCmbGmhWmPsMeoC%0at1WJFxQgD4goE0U6k%2bKt7vjbOt14Pk6v%2fB2yjaju1wSGpO59WLS4%2fXrwI2se6IXr%0amba7u3VUEgWXLriNHoLy7%2fSMNTs%2bZEKhAMG36eNe3tVdT7busTag31r6sEMGGwCs%0aIwpU%2bazosk0oylWLEX%2fm%2fuHWEs1eaIEWWWtgHB%2bKZrrP7Rr9RYfVQ144DxmOxS3C%0aa9%2bmST62WqAVPR6POWGEfZqnZl%2fePWZPcQYbFrhwnnefNoYBl%2fbnLZBo8rbNWxAq%0aOEOuKfkrBzglKG%2f39WKPw8rj4JIVzY0yOuFCW6xCDWRkOrhU8Ol%2f3FvwDa3uJpkp%0amgPr4TgxAoGBAPGPLmxSuOYR97mDAXxrs037F2GCbqWvI6m7%2fezWe9yn%2bbMpjSIW%0afsgtq4FsyqzPueEkDdQWi3xh6nu2WI%2f1Tl875opGAqEIJMqss%2fu11tnva5wzu1cC%0aL6H85A5%2bHMOBvP3sm6CObKcVw92h7kxynVIUJJWhjfeZMN8gBFFpKIVFAoGBAO1p%0atXBmXLC%2fYKKvtHI3M16%2fZopvM8ZqU2HcAHaw214Refw9JJ%2fe3%2fxTNfSerVTyCAQO%0a1AdWTzJKBN8jmSYv1Mk1D3RpQPNR7wVzi46KR081AU41uMpqIGVOwHtyVnW%2fZfLr%0ac1DLIK8Cx8aHfoxffwzoMO5SEQSooeZfOLhsfDN1AoGBAKQTUEINsj%2b75psgbAr6%0aELGgItJ9yPBLVRr%2bcUzEpx9LDWVvjMihpP4NX1gq8EOPWT%2bewLHVmmsjCyV6xw8J%0aXXF8e2xif3in0m3D%2fwCzE7u2T06rKM3B017hKnrZmGoHnrqPU2osM4sOUpshWX6d%0av1Q4EF1%2bfbK3YCW%2bVpCBsB9NAoGAQo%2buhNLODee56iKkzpjXWCsFTq6ar3hD5F3P%0a63buKdNwhd2GlSPhXFbf%2b7M5GWW6BZk6rMvv7EOAVice2uvyFm8%2f4%2f1WbmF8R%2bT7%0aLX1rPLO5p%2fm701QpvP11TabiwqRkqtSEQhSRF0AKTojSW%2fyyHCZFAawUhV%2fZ9EKi%0aHmKb97kCgYAyzmFc2it0HqnsOnRybop603nqMtWGTQO4cxa93HUDpYajuK2K3Dfr%0axUj6lG3z%2foKJGGE2JqgZ6LBAhNJtJWJu2ox3pKGE63QjLJnVwb8y1NFYpe%2fcrbLe%0aPuBwIR0L7drXxfv7O5btY7h6QI2d1%2fUIAQPAWbxLoTM%2bndQ%2fuPEdfA%3d%3d%0a-----END%20RSA%20PRIVATE%20KEY-----"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_install_ssl.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_install_ssl.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/SSL/,\n    q/install_ssl/,\n    {\n        'domain' => 'example.com',\n        'cert' => '-----BEGIN CERTIFICATE-----\nMIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD\nVQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD\nVQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l\ndDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH\nEwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU\nBgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ\nBgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu\nbmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOMAwGA1UECBMFVGV4YXMxEDAOBgNV\nBAcTB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRO0AP\nN5XtjDqkEyJ6ctfYqUtt9yUXyRuCETFjW6opNLSmZSHeF6L2aZka646lhj02CFyl\nkzsNSxysN66tY+WZcTmvgPisJdQFpFvjroJZgDjYRV0QqokKdRy/5BU0+tHXoYpj\n9JOQlbvEWxiGR3R80sL1ma4AfSE6Gv8M/PULTadan51eHaikXqjOXdPJQKuWP3g9\nFnIuf38WRYwzGrre88qsZrpsMrADX5dotHWgqAf7Tap6xfA4CUAgQo9tldariuVi\nBz+sRJ/Sjgxnhw1HYWGttBuBZFhMpdHpPnTJ7DIFMd/FN5gG/tah30SapWpo35Ux\n3BpJcdUjtazy82K5AgMBAAGjUDBOMB0GA1UdDgQWBBQAlv7/tALOYb7zAXbYG2+9\nAMI3xjAfBgNVHSMEGDAWgBQAlv7/tALOYb7zAXbYG2+9AMI3xjAMBgNVHRMEBTAD\nAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCxzpe71Hc7Es0dqIN7bhIFYIIgcr6wxM6a\na9d+QG+QPH0x0KAqV8EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr\nHRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw\ncaRtXn4uc+t6HYuW7yWesBauCWnJNiKbjN/F+uCTurN3QMAeWf3ZJtsfkAgk8dyq\nR/83a3kDtSPrpt+jX+qdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P/AAGc+\nZUhYoWcRWKw/y6gI7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a\\r\\n\n-----END CERTIFICATE-----',\n        'key' => '-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA4AVM6J4Qg3DIFWr/eJ5GRmIATYsJIepKbrDy70sq+udcO8R8\nxxak0oMZ/9mUdpjSNK/fLVTuCO0kxTfQ9VUWJllX7ThD6Zh9ZvlC/nf/OEZLm3Zb\nBgu8rbC8E9wuDOkKbJLnINgdhtowIydLK2MJ++q62bFV89jkHWTMcKyyqHENo3h\nc+lkpd9vnp8rZTinaVb7nX26uQqAFZYRo+WU0G/NPsq40QVSMoqPxyEz4qXo0hvu\nIlCXmzFZq/6fCVPEKPLhQgMmpdBkMz4dVOazREfqXdjMD2+QXSNiA1AwWr8l0r4r\ntzlxEYDJIR41yXp0xMl3KoolxMyvLBqZy32niQIDAQABAoIBAQCmbGmhWmPsMeoC\nt1WJFxQgD4goE0U6k+Kt7vjbOt14Pk6v/B2yjaju1wSGpO59WLS4/XrwI2se6IXr\nmba7u3VUEgWXLriNHoLy7/SMNTs+ZEKhAMG36eNe3tVdT7busTag31r6sEMGGwCs\nIwpU+azosk0oylWLEX/m/uHWEs1eaIEWWWtgHB+KZrrP7Rr9RYfVQ144DxmOxS3C\na9+mST62WqAVPR6POWGEfZqnZl/ePWZPcQYbFrhwnnefNoYBl/bnLZBo8rbNWxAq\nOEOuKfkrBzglKG/39WKPw8rj4JIVzY0yOuFCW6xCDWRkOrhU8Ol/3FvwDa3uJpkp\nmgPr4TgxAoGBAPGPLmxSuOYR97mDAXxrs037F2GCbqWvI6m7/ezWe9yn+bMpjSIW\nfsgtq4FsyqzPueEkDdQWi3xh6nu2WI/1Tl875opGAqEIJMqss/u11tnva5wzu1cC\nL6H85A5+HMOBvP3sm6CObKcVw92h7kxynVIUJJWhjfeZMN8gBFFpKIVFAoGBAO1p\ntXBmXLC/YKKvtHI3M16/ZopvM8ZqU2HcAHaw214Refw9JJ/e3/xTNfSerVTyCAQO\n1AdWTzJKBN8jmSYv1Mk1D3RpQPNR7wVzi46KR081AU41uMpqIGVOwHtyVnW/ZfLr\nc1DLIK8Cx8aHfoxffwzoMO5SEQSooeZfOLhsfDN1AoGBAKQTUEINsj+75psgbAr6\nELGgItJ9yPBLVRr+cUzEpx9LDWVvjMihpP4NX1gq8EOPWT+ewLHVmmsjCyV6xw8J\nXXF8e2xif3in0m3D/wCzE7u2T06rKM3B017hKnrZmGoHnrqPU2osM4sOUpshWX6d\nv1Q4EF1+fbK3YCW+VpCBsB9NAoGAQo+uhNLODee56iKkzpjXWCsFTq6ar3hD5F3P\n63buKdNwhd2GlSPhXFbf+7M5GWW6BZk6rMvv7EOAVice2uvyFm8/4/1WbmF8R+T7\nLX1rPLO5p/m701QpvP11TabiwqRkqtSEQhSRF0AKTojSW/yyHCZFAawUhV/Z9EKi\nHmKb97kCgYAyzmFc2it0HqnsOnRybop603nqMtWGTQO4cxa93HUDpYajuK2K3Dfr\nxUj6lG3z/oKJGGE2JqgZ6LBAhNJtJWJu2ox3pKGE63QjLJnVwb8y1NFYpe/crbLe\nPuBwIR0L7drXxfv7O5btY7h6QI2d1/UIAQPAWbxLoTM+ndQ/uPEdfA==\n-----END RSA PRIVATE KEY-----',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_install_ssl.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_install_ssl.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    'SSL',\n    'install_ssl',\n    array (\n        'domain' => 'example.com',\n        'cert' => '-----BEGIN CERTIFICATE-----\nMIIEEzCCAvugAwIBAgIJALF/jFpw6p1bMA0GCSqGSIb3DQEBBQUAMIGfMRYwFAYD\nVQQDEw10ZXN0c2ltb24uY29tMRYwFAYDVQQLEw1Eb2N1bWVudGF0aW9uMQswCQYD\nVQQGEwJVUzEoMCYGCSqGSIb3DQEJARYZbGF1cmVuY2Uuc2ltb25AY3BhbmVsLm5l\ndDEUMBIGA1UEChMLY1BhbmVsIEluYy4xDjAMBgNVBAgTBVRleGFzMRAwDgYDVQQH\nEwdIb3VzdG9uMB4XDTEzMDUxNzE2MTMwN1oXDTE0MDUxNzE2MTMwN1owgZ8xFjAU\nBgNVBAMTDXRlc3RzaW1vbi5jb20xFjAUBgNVBAsTDURvY3VtZW50YXRpb24xCzAJ\nBgNVBAYTAlVTMSgwJgYJKoZIhvcNAQkBFhlsYXVyZW5jZS5zaW1vbkBjcGFuZWwu\nbmV0MRQwEgYDVQQKEwtjUGFuZWwgSW5jLjEOMAwGA1UECBMFVGV4YXMxEDAOBgNV\nBAcTB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRO0AP\nN5XtjDqkEyJ6ctfYqUtt9yUXyRuCETFjW6opNLSmZSHeF6L2aZka646lhj02CFyl\nkzsNSxysN66tY+WZcTmvgPisJdQFpFvjroJZgDjYRV0QqokKdRy/5BU0+tHXoYpj\n9JOQlbvEWxiGR3R80sL1ma4AfSE6Gv8M/PULTadan51eHaikXqjOXdPJQKuWP3g9\nFnIuf38WRYwzGrre88qsZrpsMrADX5dotHWgqAf7Tap6xfA4CUAgQo9tldariuVi\nBz+sRJ/Sjgxnhw1HYWGttBuBZFhMpdHpPnTJ7DIFMd/FN5gG/tah30SapWpo35Ux\n3BpJcdUjtazy82K5AgMBAAGjUDBOMB0GA1UdDgQWBBQAlv7/tALOYb7zAXbYG2+9\nAMI3xjAfBgNVHSMEGDAWgBQAlv7/tALOYb7zAXbYG2+9AMI3xjAMBgNVHRMEBTAD\nAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCxzpe71Hc7Es0dqIN7bhIFYIIgcr6wxM6a\na9d+QG+QPH0x0KAqV8EgUbZysvyxEF0bPxW3ZAr1Is1wk80PMuU3bToFFVbFFIIr\nHRNfKLGvxiMXnZA1c6L4N0lowvXHgZxTTUXtDFLXyrcwrLsvUErEV7rbizuxqfPw\ncaRtXn4uc+t6HYuW7yWesBauCWnJNiKbjN/F+uCTurN3QMAeWf3ZJtsfkAgk8dyq\nR/83a3kDtSPrpt+jX+qdjKEpRtQ5Qpm6XT2gCOQPgnfiUtOCH419pp922P/AAGc+\nZUhYoWcRWKw/y6gI7Ru++9+8+wkadL9EbKMZxhVwD5qVm4ZlWK2a\\r\\n\n-----END CERTIFICATE-----',\n        'key' => '-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA4AVM6J4Qg3DIFWr/eJ5GRmIATYsJIepKbrDy70sq+udcO8R8\nxxak0oMZ/9mUdpjSNK/fLVTuCO0kxTfQ9VUWJllX7ThD6Zh9ZvlC/nf/OEZLm3Zb\nBgu8rbC8E9wuDOkKbJLnINgdhtowIydLK2MJ++q62bFV89jkHWTMcKyyqHENo3h\nc+lkpd9vnp8rZTinaVb7nX26uQqAFZYRo+WU0G/NPsq40QVSMoqPxyEz4qXo0hvu\nIlCXmzFZq/6fCVPEKPLhQgMmpdBkMz4dVOazREfqXdjMD2+QXSNiA1AwWr8l0r4r\ntzlxEYDJIR41yXp0xMl3KoolxMyvLBqZy32niQIDAQABAoIBAQCmbGmhWmPsMeoC\nt1WJFxQgD4goE0U6k+Kt7vjbOt14Pk6v/B2yjaju1wSGpO59WLS4/XrwI2se6IXr\nmba7u3VUEgWXLriNHoLy7/SMNTs+ZEKhAMG36eNe3tVdT7busTag31r6sEMGGwCs\nIwpU+azosk0oylWLEX/m/uHWEs1eaIEWWWtgHB+KZrrP7Rr9RYfVQ144DxmOxS3C\na9+mST62WqAVPR6POWGEfZqnZl/ePWZPcQYbFrhwnnefNoYBl/bnLZBo8rbNWxAq\nOEOuKfkrBzglKG/39WKPw8rj4JIVzY0yOuFCW6xCDWRkOrhU8Ol/3FvwDa3uJpkp\nmgPr4TgxAoGBAPGPLmxSuOYR97mDAXxrs037F2GCbqWvI6m7/ezWe9yn+bMpjSIW\nfsgtq4FsyqzPueEkDdQWi3xh6nu2WI/1Tl875opGAqEIJMqss/u11tnva5wzu1cC\nL6H85A5+HMOBvP3sm6CObKcVw92h7kxynVIUJJWhjfeZMN8gBFFpKIVFAoGBAO1p\ntXBmXLC/YKKvtHI3M16/ZopvM8ZqU2HcAHaw214Refw9JJ/e3/xTNfSerVTyCAQO\n1AdWTzJKBN8jmSYv1Mk1D3RpQPNR7wVzi46KR081AU41uMpqIGVOwHtyVnW/ZfLr\nc1DLIK8Cx8aHfoxffwzoMO5SEQSooeZfOLhsfDN1AoGBAKQTUEINsj+75psgbAr6\nELGgItJ9yPBLVRr+cUzEpx9LDWVvjMihpP4NX1gq8EOPWT+ewLHVmmsjCyV6xw8J\nXXF8e2xif3in0m3D/wCzE7u2T06rKM3B017hKnrZmGoHnrqPU2osM4sOUpshWX6d\nv1Q4EF1+fbK3YCW+VpCBsB9NAoGAQo+uhNLODee56iKkzpjXWCsFTq6ar3hD5F3P\n63buKdNwhd2GlSPhXFbf+7M5GWW6BZk6rMvv7EOAVice2uvyFm8/4/1WbmF8R+T7\nLX1rPLO5p/m701QpvP11TabiwqRkqtSEQhSRF0AKTojSW/yyHCZFAawUhV/Z9EKi\nHmKb97kCgYAyzmFc2it0HqnsOnRybop603nqMtWGTQO4cxa93HUDpYajuK2K3Dfr\nxUj6lG3z/oKJGGE2JqgZ6LBAhNJtJWJu2ox3pKGE63QjLJnVwb8y1NFYpe/crbLe\nPuBwIR0L7drXxfv7O5btY7h6QI2d1/UIAQPAWbxLoTM+ndQ/uPEdfA==\n-----END RSA PRIVATE KEY-----',\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"tags":["SSL Certificate Management"],"name":"SSL Certificates"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"show_cert":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}],"paths":{"/SSL/show_cert":{"get":{"x-cpanel-api-version":"UAPI","summary":"Export SSL certificate","tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  show_cert\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/show_cert"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_show_cert.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_show_cert.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/SSL/,\n    q/show_cert/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_show_cert.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_show_cert.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    'SSL',\n    'show_cert'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"show_cert"},"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"cert":{"description":"The contents of the certificate.","format":"pem-certificate","example":"-----BEGIN CERTIFICATE-----MIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQIDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYyMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNVBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3PXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fWvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/daM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj\\UDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3WhcDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVwFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2agqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPaKm6r7YmwfLN/YMZBHXSR58oOGP9W-----END CERTIFICATE-----","type":"string"},"text":{"type":"string","description":"The parsed information from the OpenSSL command-line tool.","example":"Certificate:\n Data:\n Version: 3 (0x2)\n Serial Number:\n d1:e8:74:8c:d0:69:d2:55\n Signature Algorithm: sha1WithRSAEncryption\n Issuer: CN = example.com, C = US, emailAddress = username@example.com, O = Example, ST = Texas, L = Houston\n Validity\n Not Before: Apr 10 22:38:10 2013 GMT\n Not After : Apr 10 22:38:10 2014 GMT\n Subject: CN = example.com, C = US, emailAddress = username@example.com, O = Example, ST = Texas, L = Houston\n Subject Public Key Info:\n Public Key Algorithm: rsaEncryption\n Public-Key: (2048 bit)\n Modulus:\n 00:c6:9c:e3:37:1a:fc:e6:1b:e4:29:4d:8e:ee:ec:\n bd:7a:52:12:ef: 34:71:64:77:e0:79:76:6d:ba:f0:\n 77:fd:f0:92:18:b0:84:c3:f7:12:3a:a9:b9:1d:16:\n 6c:a0:10:6d:f0:55:17:35:27:ff:81:a7:46:e6:d4:\n 36:97:34:01:3a:2f:6d:61:9a: 04:20:e3:fd:06:11:\n 8b:a4:5e:4f:6d:0d:93:8e:3b:cc:cb:19:b3:cb:74:\n 7a:54:82:ae:52:9e:46:31:7a:02:44:0b:7b:26:e8:\n 84:aa:91:2b:25:c1:42:0c:cc:5d:c4:d5: c4:cf:df:\n de:4c:7c:22:99:ab:06:79:99:16:1e:a7:49:5b:9b:\n 89:97:18:3c:1e:4b:c6:c5:b5:b2:9d:7d:be:b9:91:\n c6:08:38:7d:dc:81:18:2b:0c:2c:da:29:f4:aa:a2:\n 72:46:d9:c2:68:31:89:51:ab:32:af:7a:8d:9b:a7:\n d8:b8:b5:37:21:03:91:1d:4e:d8:fc:f1:0e:1f:96:\n 17:d6:90:25:c1:3a:1a:76:4c:9e:2b:7e:b9:9c:f5:\n 86:0a:cf:ea: 2f:eb:bc:33:ee:69:49:b9:c2:e6:a0:\n ef:ee:90:19:4a:2a:64:7e:ef:96:46:7e:7d:e2:35:\n ec:d9:cf:34:42:7a:3d:c1:22:b9:68:a2:b3:02:a3:\n 7f:f5\n Exponent: 65537 (0x10001)\n X509v3 extensions:\n X509v3 Subject Key Identifier:\n 6A:A1:EA:62:FB:B2:C4:AC:04:B0:43:DD:56:BE:8A:8D:FA:16:D3:F4\n X509v3 Authority Key Identifier:\n keyid:6A:A1:EA:62:FB:B2:C4:AC:04:B0:43:DD:56:BE:8A:8D:FA:16:D3:F4\n\n X509v3 Basic Constraints:\n CA:TRUE\n Signature Algorithm: sha1WithRSAEncryption\n 3c:1e:f7:3d:20:1b:a2:bd:5c:d6:0f:2a:9e:f3:b0:83:bf:a9:\n a0:90:9b:96:b1:a6:1e:8b:be:7c:f5:72:58:a0:48:3e:68: 43:\n 06:37:63:0a:cb:9c:23:98:c6:9e:f1:73:e8:4b:71:ac:07:fc:\n d0:5c:e1:55:4f:be:a7:75:5a:57:da:a1:c2:46:63:8f:3a:70:\n 4c:42:3c:03:4c:a0:47:a3:fc: ae:15:03:25:a5:78:63:a2:73:\n cd:47:d5:64:7c:d4:f5:85:f7:03:b8:b4:d8:95:75:6a:78:5c:\n e6:c7:69:02:7b:a4:fc:4d:8c:80:7b:c7:1c:71:04:ba:53:71:\n 7a: ce:00:cb:0e:5e:21:89:02:ba:90:02:8e:b5:79:8e:84:50:\n b0:21:63:b0:ac:19:80:c5:1d:a2:95:68:b7:ee:35:10:fa:db:\n f5:bf:b0:16:b1:34:76:f2:d6:ee:07:3b:6d:b6:0c:1d:b4:e5:\n 53:50:23:b8:c4:bf:fe:d6:77:ec:89:68:a0:d8:dd:f4:f5:fa:\n 7d:f6:c4:72:02:b1:e8:87:f7:e1:16:71:80:2e:e7:94:7b:eb:\n c6:a7:07:36:05:6d:34:b4:25:74:e9:c2:2c:9e:3d:bc:97:8e:\n 84:ce:cc:4f:1f:11:67:ad:30:f6:83:3e:be:bb:88:48:10:65:\n f7:4b:2f:80\n"},"details":{"type":"object","properties":{"domains":{"description":"A list of the certificate's domains.","items":{"type":"string","format":"domain","example":"example.com"},"type":"array"},"issuer":{"description":"A object that contains the issuer's details.","properties":{"emailAddress":{"description":"The issuer's email address.","format":"email","example":"username@example.com","type":"string"},"countryName":{"format":"ISO-3166-1 (alpha-2)","description":"The certificate's two-letter country code.","example":"US","type":"string"},"commonName":{"type":"string","example":"example.com","description":"The issuer's Common Name or Distinguished Name."},"localityName":{"type":"string","example":"Houston","description":"The issuer's locality or city."},"organizationName":{"type":"string","description":"The issuer's organization name.","example":"Organization"},"stateOrProvinceName":{"type":"string","example":"Texas","description":"The issuer's state or province name."}},"type":"object"},"subject":{"description":"An object containing the certificate's ownership details.","properties":{"stateOrProvinceName":{"description":"The certificate's state or province name.","example":"Texas","type":"string"},"organizationName":{"type":"string","description":"The certificate's organization name.","example":"Organization"},"commonName":{"description":"The certificate's Common Name or Distinguished Name.","example":"example.com","type":"string"},"localityName":{"example":"Houston","description":"The certificate's locality or city.","type":"string"},"countryName":{"type":"string","example":"US","description":"The certificate's two-letter country code.","format":"ISO-3166-1 (alpha-2)"},"emailAddress":{"type":"string","format":"email","description":"The certificate's email address.","example":"username@example.com"}},"type":"object"},"key_algorithm":{"type":"string","example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"description":"The certificate's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA."},"is_self_signed":{"description":"Whether the certificate is self-signed.\n\n* `1` — Self-signed.\n* `0` — Not self-signed.","example":"1","enum":["1","0"],"type":"integer"},"signature_algorithm":{"type":"string","example":"sha256WithRSAEncryption","description":"The certificate's OID hash algorithm signature."},"ecdsa_public":{"description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an ECDSA key.","example":null,"nullable":"true","type":"string"},"validation_type":{"type":"string","description":"The certificate's validation type.\n\n* `ev` — Extended Validation.\n* `ov` — Organization Validation.\n* `dv` — Domain Validation.\n* `null` — The system could not parse and determine the\ncertificate's validation type.","enum":["ev","ov","dv"],"example":"dv","nullable":"true"},"not_before":{"type":"integer","description":"The certificate's start time.","format":"unix_timestamp","example":"1569844800"},"friendly_name":{"type":"string","description":"The certificate's friendly name.","example":"TestCert"},"not_after":{"example":"1601467200","format":"unix_timestamp","description":"The certificate's expiration date.","type":"integer"},"id":{"example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041","description":"The certificate's ID.","type":"string"},"ecdsa_curve_name":{"enum":["prime256v1","secp384r1"],"example":null,"description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key.","nullable":"true","type":"string"},"modulus":{"type":"string","nullable":"true","description":"The certificate's key's modulus, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db"}},"description":"An object containing the certificate's details."}}},"status":{"example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}}}},"description":"HTTP Request was successful."}},"description":"This function retrieves a certificate.\n\n**Note:**\n\nWhen you call this parameter, you **must** include either the `id` or\nthe `friendly_name` parameter.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk,\nWebmail, **and** Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","operationId":"show_cert","parameters":[{"in":"query","name":"id","required":"false","description":"The certificate's ID.","schema":{"example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041","type":"string"}},{"description":"The certificate's friendly name.","schema":{"example":"TestCert","type":"string"},"in":"query","name":"friendly_name","required":"false"}]}}},"x-tagGroups":[{"tags":["SSL Certificate Management"],"name":"SSL Certificates"}]},"set_cert_friendly_name":{"paths":{"/SSL/set_cert_friendly_name":{"get":{"tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  set_cert_friendly_name \\\n  friendly_name='TestCert' \\\n  new_friendly_name='TestCert2'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/set_cert_friendly_name?friendly_name=TestCert&new_friendly_name=TestCert2"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_set_cert_friendly_name.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_set_cert_friendly_name.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/SSL/,\n    q/set_cert_friendly_name/,\n    {\n        'friendly_name' => 'TestCert',\n        'new_friendly_name' => 'TestCert2',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_set_cert_friendly_name.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_set_cert_friendly_name.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    'SSL',\n    'set_cert_friendly_name',\n    array (\n        'friendly_name' => 'TestCert',\n        'new_friendly_name' => 'TestCert2',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Update SSL certificate's friendly name","operationId":"set_cert_friendly_name","description":"This function changes a certificate's friendly name.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"example":"TestCert","type":"string"},"description":"The certificate's friendly name.","required":"true","in":"query","name":"friendly_name"},{"name":"new_friendly_name","in":"query","required":"true","description":"The certificate's new friendly name.","schema":{"type":"string","example":"TestCert2"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"set_cert_friendly_name","description":"The name of the method called."},"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"result":{"properties":{"data":{"nullable":"true","default":null,"type":"object"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"remove_autossl_excluded_domains":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["Auto-generated SSL Certificates"],"name":"SSL Certificates"}],"paths":{"/SSL/remove_autossl_excluded_domains":{"get":{"operationId":"remove_autossl_excluded_domains","description":"This function enables AutoSSL for the domains that you specify.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"type":"string"},"description":"Enable AutoSSL for this domain.","examples":{"single":{"value":"example.com","summary":"A single domain."},"multiple":{"summary":"Multiple domains.","value":"domains=example1.com,example2.com"}},"required":"true","in":"query","name":"domains"}],"x-cpanel-available-version":"cPanel 66","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"SSL","description":"The name of the module called."},"result":{"properties":{"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"data":{"type":"object","nullable":"true","default":null},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"description":"The name of the method called.","example":"remove_autossl_excluded_domains","type":"string"}}}}}}},"tags":["SSL","Auto-generated SSL Certificates"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  remove_autossl_excluded_domains \\\n  domains='example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/remove_autossl_excluded_domains?domains=example.com","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_remove_autossl_excluded_domains.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_remove_autossl_excluded_domains.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/SSL/,\n    q/remove_autossl_excluded_domains/,\n    {\n        'domains' => '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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_remove_autossl_excluded_domains.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_remove_autossl_excluded_domains.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    'SSL',\n    'remove_autossl_excluded_domains',\n    array (\n        'domains' => '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}"}],"x-cpanel-api-version":"UAPI","summary":"Enable AutoSSL for specifed domains"}}},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / Auto-generated SSL Certificates","name":"Auto-generated SSL Certificates"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}]},"list_csrs":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"paths":{"/SSL/list_csrs":{"get":{"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  list_csrs\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/list_csrs"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_list_csrs.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_list_csrs.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/SSL/,\n    q/list_csrs/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_list_csrs.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_list_csrs.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    'SSL',\n    'list_csrs'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["SSL","cPanel Account SSL Management"],"summary":"Return all certificate signing requests","x-cpanel-api-version":"UAPI","operationId":"list_csrs","description":"This function lists an account's certificate signing requests (CSR).\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk,\nWebmail, and Web Server\n[roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"type":"array","items":{"type":"object","properties":{"key_algorithm":{"description":"The CSR's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","enum":["rsaEncryption","id-ecPublicKey"],"example":"rsaEncryption","type":"string"},"id":{"example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041","description":"The CSR's ID.","type":"string"},"modulus":{"type":"string","description":"The CSR's key's modulus, in hexadecimal format.\n\n* `null` — The CSR's key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","nullable":"true"},"created":{"format":"unix_timestamp","description":"The CSR's creation date.","example":"1538265600","type":"integer"},"ecdsa_curve_name":{"nullable":"true","description":"The ECDSA curve that the CSR's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The CSR's key is **not** an ECDSA key.","enum":["prime256v1","secp384r1"],"example":null,"type":"string"},"domains":{"items":{"example":"example.com","format":"domain","type":"string"},"description":"A list of the domains that the CSR covers.","type":"array"},"ecdsa_public":{"nullable":"true","description":"The CSR's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The CSR's key is **not** an ECDSA key.","example":null,"type":"string"},"commonName":{"type":"string","description":"The CSR's Common Name or Distinguished Name.","example":"example.com"},"friendly_name":{"description":"The CSR's friendly name.","example":"TestCSR","type":"string"}}}},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1"}}},"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"func":{"description":"The name of the method called.","example":"list_csrs","type":"string"}},"type":"object"}}}}}}}},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"generate_csr":{"x-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}],"paths":{"/SSL/generate_csr":{"get":{"x-cpanel-api-version":"UAPI","summary":"Create certificate signing request","tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  generate_csr \\\n  domains='example.com' \\\n  countryName='US' \\\n  stateOrProvinceName='Texas' \\\n  localityName='Houston' \\\n  organizationName='Organization' \\\n  key_id='example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/generate_csr?domains=example.com&countryName=US&stateOrProvinceName=Texas&localityName=Houston&organizationName=Organization&key_id=example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_generate_csr.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_generate_csr.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/SSL/,\n    q/generate_csr/,\n    {\n        'domains' => 'example.com',\n        'countryName' => 'US',\n        'stateOrProvinceName' => 'Texas',\n        'localityName' => 'Houston',\n        'organizationName' => 'Organization',\n        'key_id' => 'example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_generate_csr.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_generate_csr.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    'SSL',\n    'generate_csr',\n    array (\n        'domains' => 'example.com',\n        'countryName' => 'US',\n        'stateOrProvinceName' => 'Texas',\n        'localityName' => 'Houston',\n        'organizationName' => 'Organization',\n        'key_id' => 'example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3',\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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"generate_csr"},"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"example":["Certificate Signing Request generated!"],"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"metadata":{"properties":{}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"],"type":"integer"},"data":{"type":"object","properties":{"key_algorithm":{"type":"string","description":"The CSR's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","enum":["rsaEncryption","id-ecPublicKey"],"example":"rsaEncryption"},"id":{"type":"string","example":"example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff","description":"The CSR's ID."},"text":{"type":"string","example":"-----BEGIN CERTIFICATE REQUEST-----\nMIIC3TCCAcUCAQAwgZcxFDASBgNVBAMMC2V4YW1wbGUuY29tMRYwFAYDVQQLDA1E\nb2N1bWVudGF0aW9uMQswCQYDVQQGEwJVUzEiMCAGCSqGSIb3DQEJARYTbGF1cmVu\nY2VAY3BhbmVsLm5ldDEUMBIGA1UECgwLY1BhbmVsIEluYy4xDjAMBgNVBAgMBVRl\neGFzMRAwDgYDVQQHDAdIb3VzdG9uMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAp092NvpqyT7mg2qDqZW1XetQGeo217o9r7AOONaTrNsMgbL/d31rQzpC\nD65SPxJ/NSpovMi48tbue3A5W6+r2CN62oFk/d34N2swN1w11NTLzOfTPQgGnBe0\nCRdqNonx68l8Cwj+auRMGakqxtaESOfx0T87Ngr/1CIqUbTzU0LembWh+1VI5Djy\n2CRmRWKkSAAu7X/OJN7cfcPh7ReZc9Ha6VmzNxbutBDRcnCJVOAGMsv2Cg4mQZhg\nyMC8KF1r/ktHneDdGJdypdrmdr0qkqzMwTaYIb6M/93Yp+bswGH4oyqa4GYeTpRu\n2OOCeydxONOnYRZWfL0SnL2Gnvnd3wIDAQABoAAwDQYJKoZIhvcNAQEFBQADggEB\nAFlolzJbcviWcdZUv+PJ7G8cAqFAxa8a3W2a0Y1U0BaMrpDfuOHpQgOtO62rr+i+\nhkrIReuk7Isyl6GoZkX17KhQ1Vo9aW8a8Ur7+0RGDbxRlK9jJWnvSFn6cMMqRSfA\nDXpptxhqBFZJIZMc3pPX9Jqycuu8bxeIvUKeSMe3Jxcl1ZXEXX47FeRZxvd+WXF9\n4Xu4KZXHdzb5tB6jPhzIaN0/3d92N/KhvCcnw3YC2fEGDkpOlZaoa7O72+aq5K3b\nM1htFv9deAHqIHefV41iOrxUCIKIhdPIjvAm774lDHLzPpJVrshO/NpA74LEkny5\nFMwKKx+6Jgx1HSWucn5kWek=\n-----END CERTIFICATE REQUEST-----","description":"The CSR's text.","format":"pem-certificate-request"},"ecdsa_curve_name":{"nullable":"true","description":"The ECDSA curve that the CSR's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The CSR's key is **not** an ECDSA key.","example":null,"enum":["prime256v1","secp384r1"],"type":"string"},"created":{"example":"1569884400","format":"unix_timestamp","description":"The date the CSR was created.","type":"integer"},"modulus":{"description":"The CSR's key's modulus, in hexadecimal format.\n\n* `null` — The CSR's key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","nullable":"true","type":"string"},"domains":{"description":"The domains that the CSR covers.","items":{"example":"example.com","format":"domain","type":"string"},"type":"array"},"commonName":{"type":"string","example":"example.com","description":"The name that issued the CSR."},"ecdsa_public":{"type":"string","nullable":"true","description":"The CSR's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The CSR's key is **not** an ECDSA key.","example":null},"friendly_name":{"description":"The CSR's friendly name.","example":"TestCSR","type":"string"}}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"SSL","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"required":"true","in":"query","name":"domains","schema":{"type":"string"},"examples":{"multiple":{"value":"domains=example-1.com,example-1.com,example-2.com","summary":"Generate a certificate for multiple domains."},"single":{"summary":"Generate a certificate for a single domain.","value":"example.com"}},"description":"A comma-separated list of the domains for which to generate the certificate."},{"required":"true","in":"query","name":"countryName","schema":{"example":"US","format":"ISO-3166-1 (alpha-2)","type":"string"},"description":"The two-letter country code."},{"schema":{"example":"Texas","type":"string"},"description":"The certificate's state or locality name.","required":"true","in":"query","name":"stateOrProvinceName"},{"description":"The certificate's city or locality name.","schema":{"type":"string","example":"Houston"},"in":"query","name":"localityName","required":"true"},{"schema":{"example":"Organization","type":"string"},"description":"The certificate's organization.","required":"true","in":"query","name":"organizationName"},{"description":"The certificate's organizational unit or department name.","schema":{"type":"string","example":"Department","default":""},"in":"query","name":"organizationalUnitName","required":"false"},{"schema":{"type":"string","example":"username@example.com","format":"email","default":""},"description":"An email address to associate with the certificate.","required":"false","in":"query","name":"emailAddress"},{"schema":{"example":"example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3","type":"string"},"description":"The key's ID.","required":"true","name":"key_id","in":"query"},{"in":"query","name":"friendly_name","required":"false","description":"A friendly name for the new certificate.\n\nThis parameter defaults to the domain name for which you generated the\ncertificate.","schema":{"type":"string","example":"TestCert"}}],"description":"This function generates a certificate signing request (CSR).\n\n**Note:**\n\nThis function **requires** a valid key in the account's `ssl` directory.\nYou can generate a key with UAPI's `SSL::generate_key` function.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\nand WebServer [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","operationId":"generate_csr"}}},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"toggle_ssl_redirect_for_domains":{"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"tags":["cPanel Account SSL Management"],"name":"SSL Certificates"}],"paths":{"/SSL/toggle_ssl_redirect_for_domains":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  toggle_ssl_redirect_for_domains \\\n  domains='main.example,addon.example,addon.main.example' \\\n  state='1'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/toggle_ssl_redirect_for_domains?domains=main.example%2caddon.example%2caddon.main.example&state=1","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_toggle_ssl_redirect_for_domains.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_toggle_ssl_redirect_for_domains.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/SSL/,\n    q/toggle_ssl_redirect_for_domains/,\n    {\n        'domains' => 'main.example,addon.example,addon.main.example',\n        'state' => '1',\n    }\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_toggle_ssl_redirect_for_domains.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_toggle_ssl_redirect_for_domains.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    'SSL',\n    'toggle_ssl_redirect_for_domains',\n    array (\n        'domains' => 'main.example,addon.example,addon.main.example',\n        'state' => '1',\n    )\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}"}],"tags":["SSL","cPanel Account SSL Management"],"summary":"Enable or disable secure redirects","x-cpanel-api-version":"UAPI","operationId":"toggle_ssl_redirect_for_domains","description":"This function enables or disables secure redirects (HTTPS) for the cPanel account's domains that you specify.\n\n**Important:**\n\nTo call this function, one of the following conditions **must** exist:\n\n* AutoSSL **must** exist on the domains for which you enable secure redirects.\n* A valid SSL certificate **must** exist for each domain for which you wish to enable secure redirects.\n* You **must** own the domains for which you wish to enable secure redirects.","parameters":[{"schema":{"type":"string","example":"main.example,addon.example,addon.main.example"},"description":"A comma-separated list of the cPanel account's domains for which to enable or disable secure redirects.\n\n**Important:**\n\nTo enable or disable redirects for addon domains, you **must** pass the addon domain **and** its subdomain.","required":"true","in":"query","name":"domains"},{"schema":{"type":"integer","enum":["0","1"],"example":"1"},"description":"Whether to enable or disable redirects for the specified domains.\n\n* `1` — Enable.\n* `0` — Disable.","required":"true","name":"state","in":"query"}],"x-cpanel-available-version":"cPanel 80","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"data":{"items":{"type":"string"},"description":"The domains for which the function enabled or disabled secure redirects.","example":["main.example","addon.example","addon.main.example"],"type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- `1` - Success\n- `0` - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}}}},"module":{"type":"string","description":"The name of the module called.","example":"SSL"},"func":{"type":"string","description":"The name of the method called.","example":"toggle_ssl_redirect_for_domains"}}}}}}}}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"get_autossl_excluded_domains":{"x-tagGroups":[{"tags":["Auto-generated SSL Certificates"],"name":"SSL Certificates"}],"paths":{"/SSL/get_autossl_excluded_domains":{"get":{"x-cpanel-available-version":"cPanel 66","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_autossl_excluded_domains","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"SSL","description":"The name of the module called."},"result":{"type":"object","properties":{"metadata":{"properties":{}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"data":{"description":"An array of objects that include domain's AutoSSL information.","items":{"type":"object","properties":{"excluded_domain":{"example":"example.com","description":"A domain that has AutoSSL disabled.","type":"string"}}},"type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}}}}}}},"description":"This function lists the domains with AutoSSL disabled.","operationId":"get_autossl_excluded_domains","parameters":[],"summary":"Return AutoSSL disabled domains","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  get_autossl_excluded_domains\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/get_autossl_excluded_domains"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_get_autossl_excluded_domains.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_get_autossl_excluded_domains.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/SSL/,\n    q/get_autossl_excluded_domains/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_get_autossl_excluded_domains.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_get_autossl_excluded_domains.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    'SSL',\n    'get_autossl_excluded_domains'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["SSL","Auto-generated SSL Certificates"]}}},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"Auto-generated SSL Certificates","description":"SSL Certificates / Auto-generated SSL Certificates"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"enable_mail_sni":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / SNI Email Settings","name":"SNI Email Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"SSL Certificates","tags":["SNI Email Settings"]}],"paths":{"/SSL/enable_mail_sni":{"get":{"x-cpanel-available-version":"cPanel 11.48","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","nullable":"true","example":["cPanel & WHM always enables mail SNI from now on."],"description":"List of messages generated by the API.","items":{"type":"string"}},"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"example":{"failed_domains":{"example2.com":"Sorry, example.com is not one of the domains on your account."},"updated_domains":{"example1.com":"1","example.com":"1"}},"properties":{"updated_domains":{"description":"An object that contains the domains with disabled mail SNI.","type":"object","additionalProperties":{"description":"Whether the domain's SNI is enabled.\n\n* `1` - Enabled.\n* `0` - Not enabled.\n\n**Note:**\n\nThe domain name is the return name.","enum":["0","1"],"example":"1","type":"integer"}},"failed_domains":{"description":"An object that contains the domains that did not enable mail SNI.","additionalProperties":{"type":"string","description":"The reason the domain failed to enable mail SNI.\n\n**Note:**\n\n The domain name is the return name.","example":"Sorry, example.com is not one of the domains on your account."},"type":"object"}},"type":"object"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"description":"The name of the method called.","example":"enable_mail_sni","type":"string"}}}}}}},"description":"This function enables SNI mail services on the specified domains.\n\n**Warning:**\n\nMail SNI is **always** enabled.\n* Mail SNI is **not** compatible with Webmail and will **not** function for any Webmail connection. Webmail connections use the cPanel service SSL certificate.\n* Functions that enable Mail SNI succeed with a warning that Mail SNI is always enabled.\n* Functions that disable Mail SNI fail and make no changes.\n\n**Important:**\n\n  When you disable the *Calendars and Contacts*, *Mail Receive*, *Web Disk*, *Webmail*, **and** *Web Server* [roles](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","operationId":"enable_mail_sni","parameters":[{"description":"A pipe-delimited list of the account's domains.","schema":{"example":"example.com|example1.com|example2.com","type":"string"},"name":"domains","in":"query","required":"true"}],"x-cpanel-api-version":"UAPI","summary":"Enable SNI mail services for domain","tags":["SSL","SNI Email Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  enable_mail_sni \\\n  domains='example.com|example1.com|example2.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/enable_mail_sni?domains=example.com%7cexample1.com%7cexample2.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_enable_mail_sni.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_enable_mail_sni.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/SSL/,\n    q/enable_mail_sni/,\n    {\n        'domains' => 'example.com|example1.com|example2.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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_enable_mail_sni.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_enable_mail_sni.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    'SSL',\n    'enable_mail_sni',\n    array (\n        'domains' => 'example.com|example1.com|example2.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}","lang":"PHP","label":"LiveAPI PHP"}]}}}},"generate_cert":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/SSL/generate_cert":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"generate_cert","description":"The name of the method called."},"result":{"properties":{"data":{"properties":{"domains":{"type":"array","description":"A list of domains that the certificate covers.","items":{"type":"string","example":"example.com","format":"domain"}},"created":{"format":"unix_timestamp","description":"The certificate's creation date.","example":"1538308800","type":"integer"},"is_self_signed":{"description":"Whether the certificate is self-signed.\n\n* `1` — Self-signed.\n* `0` — Not self-signed.","example":"1","enum":["1","0"],"type":"integer"},"key_algorithm":{"example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"description":"The certificate's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","type":"string"},"issuer.organizationName":{"type":"string","example":"Organization","description":"The certificate's Organization Name."},"subject.commonName":{"type":"string","description":"The domain that issued the certificate.","format":"domain","example":"example.com"},"friendly_name":{"example":"TestCert","description":"The certificate's friendly name.","type":"string"},"ecdsa_public":{"nullable":"true","example":null,"description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* null — The certificate's key is **not** an ECDSA key.","type":"string"},"validation_type":{"type":"string","nullable":"true","example":null,"description":"The certificate's validation type, if one exists."},"issuer.commonName":{"type":"string","example":"example.com","description":"The certificate's Common Name."},"not_before":{"type":"integer","example":"1538308800","description":"The certificate's start date.","format":"unix_timestamp"},"signature_algorithm":{"description":"The certificate's OID hash algorithm signature.","example":"sha256WithRSAEncryption","type":"string"},"ecdsa_curve_name":{"nullable":"true","description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key.","enum":["prime256v1","secp384r1"],"example":null,"type":"string"},"modulus":{"nullable":"true","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","description":"The certificate's key's modulus, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an RSA key.","type":"string"},"serial":{"type":"string","description":"The certificate's serial number.","example":"01e57e4d92"},"modulus_length":{"type":"integer","nullable":"true","example":"2048","description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key."},"id":{"example":"example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff","description":"The certificate's ID.","type":"string"},"text":{"example":"-----BEGIN CERTIFICATE-----\nMIIGBzCCA++gAwIBAgIFAeV+TZIwDQYJKoZIhvcNAQELBQAwUjELMAkGA1UECAwC\nVFgxEDAOBgNVBAcMB0hvdXN0b24xCzAJBgNVBAYTAlVTMRMwEQYDVQQDDAptcmZy\nb2cuY29tMQ8wDQYDVQQKDAZjUGFuZWwwHhcNMjAwNjA4MTUyNjA0WhcNMjEwNjA4\nMTUyNjA0WjBSMQswCQYDVQQIDAJUWDEQMA4GA1UEBwwHSG91c3RvbjELMAkGA1UE\nBhMCVVMxEzARBgNVBAMMCm1yZnJvZy5jb20xDzANBgNVBAoMBmNQYW5lbDCCAiIw\nDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK/PpzRsms2ZZmA1EG2rNYZaAq2z\nbhUGN6YMpugDwPL9xuqDwf0WUdoBjSBbty7rb5zMCZ+Ty3xHFAo15TLQXqtM0zIo\nh/FRET9rtl6EuXFFFN+eAiV4GgZJVmVMmcgXNGgSjKZHhie5THkGJbwXXRxZryHN\nQIeLlT7DttSwoAh9rEbk6hHKyyoQQ4rSkNXREUZTN3Gk7u7et8iYWl1FBkmJkFDJ\nH4Ys678md7AiXndb4YkOQd2CEgoWXMaMLWJcFkdAmrIYhRmJvyp3BzF9hEkg+qPp\nVEyIL/xVxScdxiFKGWbiHr10UiFt/0+g0gToyUXCmsfo01p0oqrk4qRSZMnUtfdX\nW06vvD64x4Z4M4Jh5WqzVEXEdppzJx09Z7MBK6GLN82pV46x8jp87cBL1LZrpWDinerx+6Vr7YC62itfp6aJ2q6vkxCh4u8T6EjPEcpZAEh5SiQZaOLhAlqgt/lwPpuCW\nQ7LEi/Vg4aG3yb/z8e2BvRK5nnCHd7OOZqg7HJ9UnrzFxeQ8KyvcxP+oYD3h0EvZ\n1zVTbJDLbYuohqbLts3Skuk1hT9HoeWqrmzn2XkoU8LkvzCcRT0oG40BfFr4z7Zz\nsKfG9Z4e06kb1YAPrSqd9w/iI1Ej8cRhBBlowYFq9RjNlkjJCwKlxzynNAJjoQ5W\nU5NJzKjUz6ChHAAtAgMBAAGjgeMwgeAwHQYDVR0OBBYEFFczMNVfcxDsyk27GfjD\nC0Z1Yv+mMAkGA1UdEwQCMAAwfgYDVR0jBHcwdYAUVzMw1V9zEOzKTbsZ+MMLRnVi\n/6ahVqRUMFIxCzAJBgNVBAgMAlRYMRAwDgYDVQQHDAdIb3VzdG9uMQswCQYDVQQG\nEwJVUzETMBEGA1UEAwwKbXJmcm9nLmNvbTEPMA0GA1UECgwGY1BhbmVsggUB5X5N\nkjAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwFQYDVR0RBA4wDIIKbXJm\ncm9nLmNvbTANBgkqhkiG9w0BAQsFAAOCAgEArbNqSdABFWy8NbpDGDAoi2rpw/aM\nWu18iEAHmPg9YekIngNpxZg4b8SB4jrNSSqB0pK8asckxmAcho/pnAx4rOFibftd\nDmGzYxGN9h60JkVToWSn3UQ/0dbqfhfTbGiQvJHTNqB3pQVvWenMFRz9XEcpMDUj\n7UKR8v2xe5Y25yvNPVezYF2/x85awlOoSa00UlKgqh0OU+iuzQZ9T3wtk5uvlc7Z\nIEzBseIn3Kp/WG3P64Rxn95YT6QssKJ+pZ412yKM7vKdcuglNLTv5cx4ffKFN1jm\nanCmPXgYsUdAazmZVSjVuVN7d2+NL+SDVczZCdJ2Vhk5DPqv8ZnHUF7MT+K6vtQd\nJ16+pszCF55t9w5uPqur67/R00dCWLpxvHRRF8J+2Xverhmex5kR6a1nUlbP1oOP\nVq+EmcAL0PP6qdDr8fkjgvNyX7hT+cuiPBbxpY6XfDSlat5+5T2lJ1Ny6GWhBnaR\n35g3EF8ysu3AYQnDwtZrOrEa08lDN3mbrkT3ImSa5oZKgOrlpCZ0dzi8p4wSrboq\n9eZyqikEvuudz+VeQf1WR/6/FsyRq2PEtjgX1atWZiPfatN5f1YVxcElTvuMzyOP\nZXjpUs8MO+CHF1FwtKm52NNItIlnUY7KPpFU8L+oa8O2BMr91wi8NpTR2gd0F+jH\n21NkfEM7YlXzgMw=\n-----END CERTIFICATE-----\n","description":"The certificate's text.","format":"pem-certificate","type":"string"},"not_after":{"type":"integer","format":"unix_timestamp","description":"The date that the certificate expires.","example":"1569844800"}},"type":"object"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{}},"messages":{"description":"List of messages generated by the API.","items":{"example":"Certificate generated","type":"string"},"nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"SSL","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"required":"true","in":"query","name":"domains","schema":{"type":"string","format":"domain"},"description":"A comma-separated list of domains for which to generate the certificate.","examples":{"single":{"value":"example.com","summary":"Generate a certificate for a domain."},"multiple":{"summary":"Generate certificates for multiple domains.","value":"domains=example1.com,example2.com,example3.com"}}},{"schema":{"example":"US","format":"ISO-3166-1 (alpha-2)","type":"string"},"description":"The two-letter country code.","required":"true","in":"query","name":"countryName"},{"schema":{"example":"TX","type":"string"},"description":"The two-letter state or locality abbreviation.","required":"true","name":"stateOrProvinceName","in":"query"},{"required":"true","name":"localityName","in":"query","schema":{"type":"string","example":"Houston"},"description":"The certificate's city or locality name."},{"in":"query","name":"organizationName","required":"true","description":"The certificate's Organization Name.","schema":{"type":"string","example":"Organization"}},{"required":"false","name":"organizationalUnitName","in":"query","schema":{"type":"string","example":"Department","default":""},"description":"The certificate's organizational unit or department name."},{"name":"emailAddress","in":"query","required":"false","description":"An email address to associate with the certificate.","schema":{"default":"","format":"email","example":"username@example.com","type":"string"}},{"in":"query","name":"key_id","required":"true","description":"The key's ID.","schema":{"type":"string","example":"example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3"}},{"description":"A friendly name for the new certificate.\n\nThis parameter defaults to the domain's name for which you generated the\ncertificate.","schema":{"example":"TestCert","type":"string"},"name":"friendly_name","in":"query","required":"false"}],"description":"This function generates a self-signed SSL certificate.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\nand Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","operationId":"generate_cert","x-cpanel-api-version":"UAPI","summary":"Create self-signed SSL certificate","tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  generate_cert \\\n  domains='example.com' \\\n  countryName='US' \\\n  stateOrProvinceName='TX' \\\n  localityName='Houston' \\\n  organizationName='Organization' \\\n  key_id='example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/generate_cert?domains=example.com&countryName=US&stateOrProvinceName=TX&localityName=Houston&organizationName=Organization&key_id=example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_generate_cert.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_generate_cert.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/SSL/,\n    q/generate_cert/,\n    {\n        'domains' => 'example.com',\n        'countryName' => 'US',\n        'stateOrProvinceName' => 'TX',\n        'localityName' => 'Houston',\n        'organizationName' => 'Organization',\n        'key_id' => 'example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_generate_cert.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_generate_cert.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    'SSL',\n    'generate_cert',\n    array (\n        'domains' => 'example.com',\n        'countryName' => 'US',\n        'stateOrProvinceName' => 'TX',\n        'localityName' => 'Houston',\n        'organizationName' => 'Organization',\n        'key_id' => 'example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3',\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}"}]}}},"x-tagGroups":[{"tags":["SSL Certificate Management"],"name":"SSL Certificates"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"SSL Certificate Management","description":"SSL Certificates / SSL Certificate Management"}]},"list_ssl_items":{"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"paths":{"/SSL/list_ssl_items":{"get":{"operationId":"list_ssl_items","description":"This function lists SSL-related items on a domain.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.com/serverroles), the system **disables** this function.","parameters":[{"description":"The domain name or names.","examples":{"multiple":{"summary":"Multiple domains.","value":"domains=example1.com|example2.com"},"single":{"summary":"A single domain.","value":"example.com"}},"schema":{"type":"string"},"in":"query","name":"domains","required":"false"},{"name":"item","in":"query","required":"false","description":"The SSL item type or types.\n* `key`\n* `csr`\n* `crt`","examples":{"multiple":{"value":"item=key|csr","summary":"Multiple item types."},"single":{"summary":"A single item type.","value":"key"}},"schema":{"type":"string","default":"key"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"SSL","description":"The name of the module called."},"result":{"type":"object","properties":{"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"data":{"items":{"properties":{"host":{"type":"string","format":"domain","description":"The hostname.","example":"example.com"},"type":{"type":"string","example":"key","enum":["key","csr","crt"],"description":"The type of SSL item.\n* `key`\n* `csr`\n* `crt`"},"id":{"example":"example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff","description":"The certificate's ID.","type":"string"}},"type":"object"},"type":"array"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"list_ssl_items","description":"The name of the method called.","type":"string"}}}}}}},"tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  list_ssl_items\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/list_ssl_items","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_list_ssl_items.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_list_ssl_items.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/SSL/,\n    q/list_ssl_items/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_list_ssl_items.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_list_ssl_items.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    'SSL',\n    'list_ssl_items'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return SSL-related items"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"check_shared_cert":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/SSL/check_shared_cert":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return whether shared SSL certificate exists","tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  check_shared_cert\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/check_shared_cert"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_check_shared_cert.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_check_shared_cert.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/SSL/,\n    q/check_shared_cert/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_check_shared_cert.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_check_shared_cert.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    'SSL',\n    'check_shared_cert'\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}","label":"LiveAPI PHP","lang":"PHP"}],"deprecated":"true","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"check_shared_cert"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"0","enum":["0","1"]},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"enum":["0","1"],"example":"0","description":"Whether a shared SSL certificate is associated with the account.\n* `1` - Associated.\n* `0` - Not associated.","type":"integer"},"metadata":{"properties":{}}},"type":"object"},"module":{"example":"SSL","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[],"operationId":"check_shared_cert","description":"This function checks whether a shared SSL certificate is associated with the account."}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}]},"set_primary_ssl":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/SSL/set_primary_ssl":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update SSL website for dedicated IP address","tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  set_primary_ssl \\\n  servername='hostname.example.com'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/set_primary_ssl?servername=hostname.example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_set_primary_ssl.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_set_primary_ssl.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/SSL/,\n    q/set_primary_ssl/,\n    {\n        'servername' => 'hostname.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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_set_primary_ssl.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_set_primary_ssl.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    'SSL',\n    'set_primary_ssl',\n    array (\n        'servername' => 'hostname.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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"set_primary_ssl","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"data":{"type":"object","nullable":"true","default":null},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"}}}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"schema":{"format":"domain","example":"hostname.example.com","type":"string"},"description":"The primary SSL website's servername.","required":"true","in":"query","name":"servername"}],"operationId":"set_primary_ssl","description":"This function sets a new primary SSL website for a dedicated IP address.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function."}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / SSL Certificate Management","name":"SSL Certificate Management"}]},"set_key_friendly_name":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/SSL/set_key_friendly_name":{"get":{"tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  set_key_friendly_name \\\n  friendly_name='TestKey' \\\n  id='a9b72_63971_2cb6d8897b362cfb1548e047d8428b8d' \\\n  new_friendly_name='TestKey2'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/set_key_friendly_name?friendly_name=TestKey&id=a9b72_63971_2cb6d8897b362cfb1548e047d8428b8d&new_friendly_name=TestKey2","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_set_key_friendly_name.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_set_key_friendly_name.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/SSL/,\n    q/set_key_friendly_name/,\n    {\n        'friendly_name' => 'TestKey',\n        'id' => 'a9b72_63971_2cb6d8897b362cfb1548e047d8428b8d',\n        'new_friendly_name' => 'TestKey2',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_set_key_friendly_name.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_set_key_friendly_name.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    'SSL',\n    'set_key_friendly_name',\n    array (\n        'friendly_name' => 'TestKey',\n        'id' => 'a9b72_63971_2cb6d8897b362cfb1548e047d8428b8d',\n        'new_friendly_name' => 'TestKey2',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Update private key's friendly name","operationId":"set_key_friendly_name","description":"This function changes a key's friendly name.\n\n**Important:**\n\n* You **must** call either the `friendly_name` or `id` parameter.\n* When you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"type":"string","example":"TestKey"},"description":"The key's friendly name.","required":"true","name":"friendly_name","in":"query"},{"name":"id","in":"query","required":"true","description":"The key's ID.","schema":{"example":"a9b72_63971_2cb6d8897b362cfb1548e047d8428b8d","type":"string"}},{"required":"true","in":"query","name":"new_friendly_name","schema":{"example":"TestKey2","type":"string"},"description":"The key's new friendly name."}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"set_key_friendly_name"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"SSL"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / SSL Certificate Management","name":"SSL Certificate Management"}]},"get_cn_name":{"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/SSL/get_cn_name":{"get":{"parameters":[{"required":"true","name":"domain","in":"query","schema":{"anyOf":[{"type":"string","format":"domain","description":"A valid domain."},{"description":"A valid email address.","format":"email","type":"string"},{"type":"string","description":"A valid cPanel username.","format":"username"}]},"example":"example.com","description":"A domain name, cPanel username, or email address."},{"required":"true","name":"service","in":"query","schema":{"enum":["cpanel","imap","pop3","smtp"],"example":"cpanel","type":"string"},"description":"The service's name.\n\n* `cpanel`\n* `imap`\n* `pop3`\n* `smtp`"},{"in":"query","name":"add_mail_subdomain","required":"false","description":"Whether to append `mail` to the `domain` value to find the best match.\n\nFor example, if you specify the domain `example.com` and call this parameter, the\nfunction only searches the `mail.example.com` service domains.\n\n* `1` — Append `mail` to the `domain` value during the search.\n* `0` — Match on the specified `domain` value **only**.","schema":{"default":"0","enum":["1","0"],"example":"0","type":"integer"}}],"description":"This function retrieves the most secure domain for a service.","operationId":"get_cn_name","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_cn_name"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"properties":{"cert_match_method":{"type":"string","description":"The method that the system used to match the certificate with the mail\nservice.\n\n* `none` — No domain matches the certificate.\n* `exact` — The domain exactly matches the certificate.\n* `exact-wildcard` — The domain exactly matches the certificate.\n* `mail-wildcard` — The `mail` subdomain of the domain matches the domain of the wildcard certificate.\n* `www-wildcard` — The `www` subdomain of the domain matches the domain of the wildcard certificate.\n* `hostname-wildcard` — The hostname's domain matches the domain of the wildcard certificate.\n* `hostname` — The hostname matches the domain of the certificate.\n* `localdomain_on_cert-mail-wildcard` — A `mail` subdomain of a domain on the server that matches the certificate.\n* `localdomain_on_cert-www-wildcard` — A `www` subdomain of a domain on the server matches the certificate.\n* `localdomain_on_cert` — A domain on the server matches the certificate.","example":"hostname","enum":["none","exact","exact-wildcard","mail-wildcard","www-wildcard","hostname-wildcard","hostname","localdomain_on_cert-mail-wildcard","localdomain_on_cert-www-wildcard","localdomain_on_cert"]},"ssldomain_matches_cert":{"enum":["1","0"],"example":"1","description":"Whether an SSL-protected domain matches the certificate.\n\n* `1` — Matches.\n* `0` — Does **not** match.","type":"integer"},"is_self_signed":{"type":"integer","example":"1","enum":["1","0"],"description":"Whether the certificate is self-signed.\n\n* `1` — Self-signed.\n* `0` — Not self-signed.\n\n**Note:**\n\nIf the `cert_match_method` value is `none`, you should ignore this return's value."},"cert_valid_not_after":{"type":"integer","description":"The certificate's expiration date.","format":"unix_timestamp","example":"1394288638"},"is_wild_card":{"example":"0","enum":["1","0"],"description":"Whether the certificate is a wildcard certificate.\n\n* `1` — Wildcard.\n* `0` — Not a wildcard.","type":"integer"},"ssldomain":{"example":"hostname.example.com","format":"domain","description":"The best domain to use to access the service.","type":"string"},"is_currently_valid":{"description":"Whether the certificate is currently valid.\n\n* `1` — Valid.\n* `0` — Invalid.\n\n**Note:**\n\nIf the certificate is valid, the following statements are true:\n  * The certificate is **not** self-signed (the `ssldomain_matches_cert` value is `1`).\n  * The certificate matches the SSL domain (the `ssldomain_matches_cert` value is `1`).\n  * The certificate is within its validity period (the `cert_valid_not_after` value is **less** than the current time and date).","enum":["1","0"],"example":"0","type":"integer"}},"type":"object"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"],"type":"integer"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","description":"The name of the module called.","example":"SSL"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  get_cn_name \\\n  domain='example.com' \\\n  service='cpanel'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/get_cn_name?domain=example.com&service=cpanel"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_get_cn_name.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_get_cn_name.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/SSL/,\n    q/get_cn_name/,\n    {\n        'domain' => 'example.com',\n        'service' => 'cpanel',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_get_cn_name.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_get_cn_name.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    'SSL',\n    'get_cn_name',\n    array (\n        'domain' => 'example.com',\n        'service' => 'cpanel',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["SSL","cPanel Account SSL Management"],"summary":"Request best SSL domain for service","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["cPanel Account SSL Management"],"name":"SSL Certificates"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}]},"can_ssl_redirect":{"paths":{"/SSL/can_ssl_redirect":{"get":{"parameters":[],"description":"This function determines whether the system can automatically redirect domains on a cPanel account to use SSL.","operationId":"can_ssl_redirect","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"data":{"enum":["0","1"],"example":"1","description":"Whether the system can automatically redirect the domains to use SSL.\n* `1` - Can redirect.\n* `0` - **Cannot** redirect.","type":"integer"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"example":"SSL","description":"The name of the module called.","type":"string"},"func":{"type":"string","example":"can_ssl_redirect","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 80","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  can_ssl_redirect\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/can_ssl_redirect"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_can_ssl_redirect.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_can_ssl_redirect.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/SSL/,\n    q/can_ssl_redirect/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_can_ssl_redirect.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_can_ssl_redirect.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    'SSL',\n    'can_ssl_redirect'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SSL","cPanel Account SSL Management"],"summary":"Return whether domains can redirect to secure URL","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"get_cabundle":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}],"paths":{"/SSL/get_cabundle":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"get_cabundle","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"SSL"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"metadata":{"properties":{}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"properties":{"cab":{"example":"-----BEGIN CERTIFICATE----- MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYD VQQKEw9HVEUgQ29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJv b3QwHhcNOTYwMjIzMjMwMTAwWhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJV UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMRwwGgYDVQQDExNHVEUgQ3liZXJU cnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC45k+625h8cXyv RLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH6X4M ypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/5 1KiOQswkwB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKz dcZfHeFhVYAA1IFLezEPI2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWl IjeaY8JIILTbcuPI9tl8vrGvU9oUtCG41tWW4/5ODFlitppK+ULdjG+BqXH/9Apy bW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY -----END CERTIFICATE-----","description":"The CA bundle's contents.","format":"pem-certificate","type":"string"},"domain":{"description":"The certificate's hostname.","format":"domain","example":"example.com","type":"string"},"bundle":{"type":"string","description":"The CA bundle's tag.","example":"VeriSign Trial Secure Server CA - G2"}},"type":"object"}},"type":"object"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"required":"true","in":"query","name":"cert","schema":{"type":"string","example":"-----BEGIN CERTIFICATE-----\\r\\nMIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ\\r\\nc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI\\r\\nDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy\\r\\nMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV\\r\\nBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G\\r\\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P\\r\\nXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW\\r\\nvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da\\r\\nM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC\\r\\n+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6\\r\\nPLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj\\r\\nUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw\\r\\n+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA\\r\\nA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh\\r\\ncDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw\\r\\nFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh\\r\\n/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag\\r\\nqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa\\r\\nKm6r7YmwfLN/YMZBHXSR58oOGP9W\\r\\n-----END CERTIFICATE-----","format":"pem-certificate"},"description":"The certificate's text."}],"description":"This function retrieves a certificate's Certificate Authority (CA) bundle and hostname.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"get_cabundle","x-cpanel-api-version":"UAPI","summary":"Return certificate's CA bundle and hostname","tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty --user=username SSL get_cabundle cert='-----BEGIN CERTIFICATE-----\\r\\nMIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ\\r\\nc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI\\r\\nDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy\\r\\nMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV\\r\\nBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G\\r\\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P\\r\\nXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW\\r\\nvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da\\r\\nM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC\\r\\n+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6\\r\\nPLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj\\r\\nUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw\\r\\n+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA\\r\\nA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh\\r\\ncDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw\\r\\nFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh\\r\\n/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag\\r\\nqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa\\r\\nKm6r7YmwfLN/YMZBHXSR58oOGP9W\\r\\n-----END CERTIFICATE-----'"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/get_cabundle?cert=-----BEGIN%20CERTIFICATE-----%5cr%5cnMIIDcTCCAlmgAwIBAgIFAU%2bBNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ%5cr%5cnc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI%5cr%5cnDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy%5cr%5cnMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV%5cr%5cnBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G%5cr%5cnCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P%5cr%5cnXx3YHsjFEWW7e5pH0vZ%2bjVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD%2bo9fW%5cr%5cnvoK1tWJS72FSgPju%2b58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri%2fda%5cr%5cnM3PBWO8ET48FWkyU1kOeZaUlF67%2f%2bwrEiNgg%2bt1qhKOCAB61PdNVkLaSGHimksuC%5cr%5cn%2bCzk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB%2fF9ORe74yTzD%2bvlk0tFMG6%5cr%5cnPLj%2fajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3%2fmgvit0v6dAgMBAAGj%5cr%5cnUDBOMB0GA1UdDgQWBBRw%2bwKBo34%2bbgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw%5cr%5cn%2bwKBo34%2bbgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH%2fMA0GCSqGSIb3DQEBBQUA%5cr%5cnA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7%2f6DQ%2fI3hv3Wh%5cr%5cncDDIO04I2%2fXhe88MLBaLoM367Ya%2bvy7CaLr14aLi%2fSfQszMA0ALBvMao%2bFis0iVw%5cr%5cnFYq%2fNLgSXw%2bfgnpFskt8v8iQZ%2b4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh%5cr%5cn%2fSD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ%2bEioo3hhgwNavH2ag%5cr%5cnqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy%2f4oQNdg6fOq4l%2fFrajBv%2bWkzDVPa%5cr%5cnKm6r7YmwfLN%2fYMZBHXSR58oOGP9W%5cr%5cn-----END%20CERTIFICATE-----","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_get_cabundle.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_get_cabundle.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/SSL/,\n    q/get_cabundle/,\n    {\n        'cert' => '-----BEGIN CERTIFICATE-----\\r\\nMIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ\\r\\nc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI\\r\\nDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy\\r\\nMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV\\r\\nBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G\\r\\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P\\r\\nXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW\\r\\nvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da\\r\\nM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC\\r\\n+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6\\r\\nPLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj\\r\\nUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw\\r\\n+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA\\r\\nA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh\\r\\ncDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw\\r\\nFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh\\r\\n/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag\\r\\nqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa\\r\\nKm6r7YmwfLN/YMZBHXSR58oOGP9W\\r\\n-----END CERTIFICATE-----',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_get_cabundle.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_get_cabundle.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    'SSL',\n    'get_cabundle',\n    array (\n        'cert' => '-----BEGIN CERTIFICATE-----\\r\\nMIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ\\r\\nc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI\\r\\nDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy\\r\\nMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV\\r\\nBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G\\r\\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P\\r\\nXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW\\r\\nvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da\\r\\nM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC\\r\\n+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6\\r\\nPLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj\\r\\nUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw\\r\\n+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA\\r\\nA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh\\r\\ncDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw\\r\\nFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh\\r\\n/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag\\r\\nqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa\\r\\nKm6r7YmwfLN/YMZBHXSR58oOGP9W\\r\\n-----END CERTIFICATE-----',\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}"}]}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"mail_sni_status":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"tags":["SNI Email Settings"],"name":"SSL Certificates"}],"paths":{"/SSL/mail_sni_status":{"get":{"x-cpanel-available-version":"cPanel 11.48","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"data":{"properties":{"enabled":{"example":"1","enum":["0","1"],"description":"Whether SNI for mail is enabled.\n* `1` - SNI is enabled.\n* `0` - SNI is **not** enabled.","type":"integer"}},"type":"object"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}}},"type":"object"},"module":{"type":"string","example":"SSL","description":"The name of the module called."},"func":{"example":"mail_sni_status","description":"The name of the method called.","type":"string"}}}}}}},"description":"This function retrieves the status of the domain's SNI mail services.\n\n**Warning:**\n\nMail SNI is **not** compatible with Webmail and will not function for any Webmail connection. Webmail connections use the cPanel service SSL certificate.\n\n**Note:**\n\nMail SNI is always enabled.\n* Functions that enable Mail SNI succeed with a warning that Mail SNI is always enabled.\n* Functions that disable Mail SNI fail and make no changes.","operationId":"mail_sni_status","parameters":[{"name":"domain","in":"query","required":"true","description":"The account's domain.","schema":{"type":"string","format":"domain","example":"example.com"}}],"x-cpanel-api-version":"UAPI","summary":"Return status of domain's SNI mail services","tags":["SSL","SNI Email Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  mail_sni_status \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/mail_sni_status?domain=example.com","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_mail_sni_status.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_mail_sni_status.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/SSL/,\n    q/mail_sni_status/,\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_mail_sni_status.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_mail_sni_status.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    'SSL',\n    'mail_sni_status',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"SNI Email Settings","description":"SSL Certificates / SNI Email Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}]},"delete_cert":{"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / SSL Certificate Management","name":"SSL Certificate Management"}],"paths":{"/SSL/delete_cert":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"delete_cert","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"data":{"type":"array","items":{"type":"object","properties":{"is_self_signed":{"type":"integer","description":"Whether the certificate is self-signed.\n\n* `1` — Self-signed.\n* `0` — Not self-signed.","enum":["1","0"],"example":"1"},"created":{"type":"integer","format":"unix_timestamp","description":"The date the certificate was created.","example":"1538308800"},"subject.commonName":{"example":"example.com","description":"The certificate's Common Name.","type":"string"},"issuer.organizationName":{"type":"string","example":"Organization","description":"The certificate's Organization Name."},"key_algorithm":{"example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"description":"The certificate's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","type":"string"},"subject_text":{"example":"commonName\nwww.example.com","description":"The certificate's subject text information.","type":"string"},"domains":{"description":"A list of the domains that the certificate covers.","items":{"type":"string","example":"example.com","format":"domain"},"type":"array"},"serial":{"type":"string","description":"The certificate's serial number.","example":"45462cd0d6537b20cf2f3eb8aec07140"},"modulus_length":{"example":"2048","description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key.","nullable":"true","type":"integer"},"id":{"type":"string","description":"The certificate's ID.","example":"example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3"},"modulus":{"description":"The certificate's key's modulus, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","nullable":"true","type":"string"},"ecdsa_curve_name":{"description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key.","enum":["prime256v1","secp384r1"],"example":null,"nullable":"true","type":"string"},"not_after":{"description":"The date the certificate expired.","format":"unix_timestamp","example":"1569844800","type":"integer"},"friendly_name":{"description":"The certificate's friendly name.","example":"TestCert","type":"string"},"signature_algorithm":{"type":"string","example":"sha256WithRSAEncryption","description":"The certificate's OID signature hash algorithm."},"issuer_text":{"type":"string","example":"countryName\nUS\nstateOrProvinceName\nTX\nlocalityName\nHouston\norganizationName\nOrganization\ncommonName\nexample.com","description":"The certificate's issuer information."},"not_before":{"example":"1538308800","description":"The date the certificate started.","format":"unix_timestamp","type":"integer"},"issuer.commonName":{"description":"The certificate's Common Name.","example":"example.com","type":"string"},"validation_type":{"type":"string","nullable":"true","enum":["ev","ov","dv"],"example":"dv","description":"The certificate's validation type.\n\n* `ev` — Extended Validation.\n* `ov` — Organization Validation.\n* `dv` — Domain Validation.\n* `null` — The system could not parse and determine the\ncertificate's validation type."},"ecdsa_public":{"type":"string","description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an ECDSA key.","example":null,"nullable":"true"}}}},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"SSL"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"in":"query","name":"id","required":"false","description":"The certificate's ID.","schema":{"type":"string","example":"example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3"}},{"description":"The certificate's friendly name.","schema":{"example":"TestCert","type":"string"},"name":"friendly_name","in":"query","required":"false"}],"operationId":"delete_cert","description":"This function deletes an SSL certificate.\n\n**Note:**\n\n* When you call this function, you **must** include the `id` or the `friendly_name`\nparameter.\n* This function **only** deletes certificates from SSL storage. To end SSL\ncoverage for a domain, use the UAPI `SSL::delete_ssl` function instead.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\nand Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","x-cpanel-api-version":"UAPI","summary":"Delete SSL certificate","tags":["SSL","SSL Certificate Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  delete_cert\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/delete_cert"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_delete_cert.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_delete_cert.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/SSL/,\n    q/delete_cert/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_delete_cert.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_delete_cert.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    'SSL',\n    'delete_cert'\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-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}]},"upload_cert":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / SSL Certificate Management","name":"SSL Certificate Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"SSL Certificates","tags":["SSL Certificate Management"]}],"paths":{"/SSL/upload_cert":{"post":{"x-cpanel-api-version":"UAPI","summary":"Import SSL certificate","tags":["SSL","SSL Certificate Management"],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"crt":{"description":"The certificate file.","format":"pem-certificate","type":"string"},"friendly_name":{"description":"The certificate's friendly name.","type":"string"}}}}},"description":"The certificate's contents."},"x-codeSamples":[{"source":"uapi --input=json --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  upload_cert\n","label":"CLI","lang":"Shell"},{"source":"POST /cpsess##########/execute/SSL/upload_cert HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 0\n\n","label":"HTTP Request (Wire Format)","lang":"HTTP"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"upload_cert"},"module":{"example":"SSL","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1"},"data":{"type":"array","items":{"properties":{"domains":{"description":"A list of the certificate's domains.","items":{"format":"domain","example":"example.com","type":"string"},"type":"array"},"created":{"type":"integer","example":"1569844800","format":"unix_timestamp","description":"The certificate's creation date."},"is_self_signed":{"example":"1","enum":["1","0"],"description":"Whether the certificate is self-signed.\n\n* `1` — Self-signed.\n* `0` — Not self-signed.","type":"integer"},"key_algorithm":{"example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"description":"The certificate's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","type":"string"},"subject.commonName":{"example":"example.com","description":"The issuer's Common Name or Distinguished Name.","type":"string"},"issuer.organizationName":{"type":"string","example":"VeriSign, Inc.","description":"The issuer's Organization Name."},"friendly_name":{"type":"string","description":"The certificate's friendly name.","example":"TestCert"},"not_before":{"type":"integer","format":"unix_timestamp","description":"The certificate's start date.","example":"1569844800"},"validation_type":{"type":"string","enum":["ev","ov","dv"],"example":"dv","description":"The certificate's validation type.\n\n* `ev` — Extended Validation.\n* `ov` — Organization Validation.\n* `dv` — Domain Validation.\n* `null` — The system could not parse and determine\nthe certificate's validation type.","nullable":"true"},"issuer.commonName":{"type":"string","description":"The issuer's Common Name or Distinguished Name.","example":"VeriSign Trial Secure Server CA - G2"},"ecdsa_public":{"type":"string","example":null,"description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an ECDSA key.","nullable":"true"},"signature_algorithm":{"type":"string","example":"sha256WithRSAEncryption","description":"The certificiate's OID hash algorithm signature."},"modulus":{"type":"string","nullable":"true","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","description":"The certificate's key's modulus, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an RSA key."},"ecdsa_curve_name":{"example":null,"enum":["prime256v1","secp384r1"],"description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key.","nullable":"true","type":"string"},"id":{"type":"string","example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041","description":"The certificate's ID."},"modulus_length":{"type":"integer","minimum":"1","nullable":"true","description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"2048"},"not_after":{"example":"1601467200","description":"The certificate's expiration date.","format":"unix_timestamp","type":"integer"}},"type":"object"}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}},"description":"HTTP Request was successful."}},"description":"This function uploads a certificate.\n\n**Important:**\n\n* Due to the limited field length of HTTP GET method calls, you **must** use the HTTP\nPOST method. For this reason, you **cannot** use a cPanel or Webmail session URL to\ncall this function.\n* When you disable the Calendar and Contacts, Receive Mail, Web Disk, Webmail, and\nWeb Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","operationId":"upload_cert","parameters":[{"required":"true","in":"query","name":"crt","schema":{"format":"pem-certificate","example":"\"-----BEGIN CERTIFICATE-----/nMIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQIDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYyMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNVBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3PXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fWvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/daM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6PLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGjUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3WhcDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVwFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2agqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPaKm6r7YmwfLN/YMZBHXSR58oOGP9W/n-----END CERTIFICATE-----\"","type":"string"},"description":"The certificate's contents."},{"description":"The certificate's friendly name.","schema":{"type":"string","example":"TestCert"},"name":"friendly_name","in":"query","required":"false"}]}}}},"is_sni_supported":{"x-tagGroups":[{"tags":["SNI Email Settings"],"name":"SSL Certificates"}],"paths":{"/SSL/is_sni_supported":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"result":{"type":"object","properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"metadata":{"properties":{}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the Apache web server supports SNI.\n* `1` - Supported.\n* `0` - **Not** supported."}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"example":"is_sni_supported","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"operationId":"is_sni_supported","description":"This function checks whether the Apache web server supports SNI.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return whether Apache web server supports mail SNI","tags":["SSL","SNI Email Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  is_sni_supported\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/is_sni_supported"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_is_sni_supported.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_is_sni_supported.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/SSL/,\n    q/is_sni_supported/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_is_sni_supported.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_is_sni_supported.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    'SSL',\n    'is_sni_supported'\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}"}]}}},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"description":"SSL Certificates / SNI Email Settings","name":"SNI Email Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"fetch_cert_info":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"paths":{"/SSL/fetch_cert_info":{"get":{"tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  fetch_cert_info \\\n  id='example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3' \\\n  friendly_name='TestCert'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/fetch_cert_info?id=example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3&friendly_name=TestCert","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_fetch_cert_info.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_fetch_cert_info.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/SSL/,\n    q/fetch_cert_info/,\n    {\n        'id' => 'example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3',\n        'friendly_name' => 'TestCert',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_fetch_cert_info.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_fetch_cert_info.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    'SSL',\n    'fetch_cert_info',\n    array (\n        'id' => 'example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3',\n        'friendly_name' => 'TestCert',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Return SSL certificate information","description":"This function retrieves all of a certificate's available information.\n\n**Important:**\n\n* You **must** call either the `friendly_name` or `id` parameter.\n* When you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"fetch_cert_info","parameters":[{"name":"id","in":"query","required":"true","description":"The certificate's ID.","schema":{"type":"string","example":"example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3"}},{"schema":{"example":"TestCert","type":"string"},"description":"The certificate's human readable name.","required":"true","in":"query","name":"friendly_name"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"fetch_cert_info"},"result":{"properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"data":{"type":"object","properties":{"subject.commonName_ip":{"type":"string","example":"192.168.0.1","format":"ipv4","description":"The IP address."},"key":{"description":"The private key.","format":"pem-private-key","example":"-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEA5n3ZUoGCgH48vcbZfrYqnrak7yOZk/UN41gr8bZGmqbzd3qK\nmGXkm11aW1ID2YKGKYjLmKt59HbXitlH6VhQcWviuYr+JIyTXDMLV0GiGpDT0uvd\ne3YV21Ww2i5nzoFxWyVD67oize5gvq9gaw5nVj6UyZ0baIB01QeJ5x52xZyuSgiS\n0ssWlA3rvHx8wG0+1trRaBwU0cn1cXP3ZMKzKus/yAUH4lMBFf8jgDzEWIwfMI5H\nmzUjg2kOPJQlBtZ1u0bJGaKffWIMLs9Ux4p+f7FNeT/xJCHCTX7HpYDOyWwq109y\nHnD178NkywKoUvtx7f93tTI821mltPbC1PQUgQIDAQABAoIBAEteX4/hFYFaxhXw\nTfJnCgzaAHTdkTyWZyJC/UP0rIWpjfdFtMg8mVJMZl1yJhwb2C8AskKL34o44iZf\nAmrFHBjahFrSuC9PYGhHsK+poI47SWixA815QZBlJt1RS1R1c1Gwj9MnHHZmOnBf\n/JFFNnk3IYQDwZCcYJfATVGr3n6jLEGNwaPWFV6SHf0C4tCibSdNkkS1L/u+roHK\n2dlmo84suwiqIYlxRCh0rZcvcx5ieF5Rj9g9t2ReYWCuEOMWuPcCfWoe4VngrmMX\nV4I8NS1wtMR8qONJf4B9vcBA36296x1PZp3QEWU6hCd3TKpInKKxe6tOJA1iZ/H0\nKn0sYSECgYEA/W2zPsHKZDHnLN80MdiRFIPnmBvdNl2kPl244S9YFCHULowxx4YA\nMhz46dkm7VAFJdCTDZvKNZloPRG6N+Ouw2TP/gwnqZzVN2jt7+rpSYWp8s8kAASv\npmjnpGLlAZg8BBD/gafxfjEdyB7QEUF379o+0WTxCJrcE8n8UtTcXj0CgYEA6NSR\nf1bXcfzCzLtkudEfyA9+u5mdENqoqasLfJsLzezeGFAYamQsnEEACWSbJvogHHZk\ng/gKVuSzspLDWpJT96agmUFGKoBozJrOj2TpXfSI9uDaGo0/YJsPhnuPHab0jiO5\nCjpCOAKMXaV9lbALRh4ALGiODDDud2rqzph815UCgYEA2ULKf+qzD+KYRSe1H2aC\nOgw653Q72Pe+bpj6flKQN/IobR9TLbH7SPr9ibzYWmpXf2uoJeqBGCJD8tbXxkIy\n+N/cT/crqYUCZVZXZW8GQDmO0NI0Eq/xxb/5ljwSB6PzD6li4kyQA5cn6QBBcAmo\nQL/hSrI20SGxumVXI8vIgCECgYAUJai9cx9LfsrAeoq5xY3Rev3FcAJ2XeVwYRuq\nWaRI2nFRe0TRl/+AOeOt7GW8lrJGpDwIa2NBp6KhFjAPW1AmwuVsvYg7z0bCRbcQ\nE3RaK/naGxTkbUqJqoFKatC0iSjqT88IQohOXnIU/GgEluoy1A/Bx/5asbVA4iCV\nZf6PjQKBgA0A3Q5lrWwuQlCXDiwsRLKSYEwgt5TFKfbiipB01m89PGd1ylz+Uzyn\niE01Cuar6yN9pJiTJ09Tmq3S2xxavY97KFHyu6R8/jHx4mZi9OMJfxffC+84q6d+\nXVABiqBs1l0ebWCsotdXoYDDQaVrCccxPfCjUCtPmgnarz11uhZo\n-----END RSA PRIVATE KEY-----","type":"string"},"certificate":{"type":"string","description":"The certificate's contents.","format":"pem-certificate","example":"-----BEGIN CERTIFICATE-----\nMIIDyDCCArDgBwIBAgIEWXcZhjANBgkzpkiG6w0BAQsFADATMREwDwYDVQQDDAhu\nZXcxLnRsZDAeFw1yMDAyMDcxMzE5MTdaFw0yMTAyMDYxMzE4MTdaMBMxETAPBgMB\nBAMMCG5ldzEudGxkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5n3Z\nUoGCgH48vcbZfrWtnrak4yOZk/UN45gc8bZGmqbzd3qKmGXkm11aW1ID2YKGKYjL\nmKt42HbXitlH6VhQcWviuYg+JIyTXDMLV0GiGpDT0uvde3YV21Ww2i5nzoFxWyVD\n67oize5gvq9gaw5nVj6UyZ0baIB01QeJ5x52xZyuSgiS0ssWlA3rvHx8wG0+1trR\naBwU0cn1cXP3ZMKzKus/yAUH4lMBFf8jgDzEWIwfMI5HmzUjg2kOPJQlBtZ1u0bJ\nGaKffWIMLs9Ux4p+f7FNeT/xJCHCTX7HpYDOyWwq109yHnD178NkywKoUvtx7f93\ntTI821mltPbC1PQUgQIDAQABo4IBIjCCAR4wHQYDVR0OBBYEFLThoqhCEONRK3X1\nFBgZ4gp+ESmJMAkGA1UdEwQCMAAwPgYDVR0jBDcwNYAUtOGiqEIQ41ErdfUUGBni\nCn4RKYmhF6QVMBMxETAPBgNVBAMMCG5ldzEudGxkggRZdxmGMB0GA1UdJQQWMBQG\nCCsGAQUFBwMBBggrBgEFBQcDAjCBkgYDVR0RBIGKMIGHgghuZXcxLnRsZIINbWFp\nbC5uZXcxLnRsZIIMd3d3Lm5ldzEudGxkgg9jcGFuZWwubmV3MS50bGSCEHdlYm1h\naWwubmV3MS50bGSCEHdlYmRpc2submV3MS50bGSCE2NwY29udGFjdHMubmV3MS50\nbGSCFGNwY2FsZW5kYXJzLm5ldzEudGxkMA0GCSqGSIb3DQEBCwUAA4IBAQCT4AQM\nwbwj3JEoQIJeP7RQyVe2/CPheqkSSajca1a3cUytwfRQ/m8DGM3L3WUZCaDEXYpJ\n+nt7k6KetL6Fs03e1W7IDADt68ahiBLIqvxEGZ5uNUYqOiEWgfp3yKEDOjkLLvzU\nGZb8FmNyeDoQ47b0mf0SRktG6W1rTMAg2kSDVoA7YNZStYvRzEliCX8cZqZ2as2d\nou95S+aGFAPJ+WMyYRgFm+ONAnpSbd9BursEcQSfLjKLusJzXrGVG9zZ/CAK2tHy\nXIlFrj88r0q9AZKyFkh6O1XvaZBiI/UEOWS2H3zcnh5ywudze7jTj5eFz5hr0ubX\ndji/LDNHmG+dKCK7\n-----END CERTIFICATE-----"},"cabundle":{"format":"pem-certificate","description":"The CA bundle's contents (if applicable).","example":"-----BEGIN CERTIFICATE-----\nMIIB+DCCArDgBwIBAgIEWXcZhjANBgkzpkiG6w0BAQsFADATMREwDwYDVRRZZAhu\nZXcxLnRsZDAeFw1yMDAyMDcxMzE7MTdaFw0yMTAyMDYxMzE4MTdaMBMxETAPBgEJ\nBAMMCG5ldzEudGxkMIJBInANBgkqhkiG9w0BAQEFAAOKAR3AMIIBCgKCAQEA5n3Z\nUoGCgH48vcbZfrWtnrak4yOZk/UN45gc8bZGmqbzd3qKmGXkm11aW1ID2YKGKYjL\nmKt42HbXitlH6VhQcWviuYg+JIyTXDMLV0GiGpDT0uvde3YV21Ww2i5nzoFxWyVD\n67oize5gvq9gaw5nVj6UyZ0baIB01QeJ5x52xZyuSgiS0ssWlA3rvHx8wG0+1trR\naBwU0cn1cXP3ZMKzKus/yAUH4lMBFf8jgDzEWIwfMI5HmzUjg2kOPJQlBtZ1u0bJ\nGaKffWIMLs9Ux4p+f7FNeT/xJCHCTX7HpYDOyWwq109yHnD178NkywKoUvtx7f93\ntTI821mltPbC1PQUgQIDAQABo4IBIjCCAR4wHQYDVR0OBBYEFLThoqhCEONRK3X1\nFBgZ4gp+ESmJMAkGA1UdEwQCMAAwPgYDVR0jBDcwNYAUtOGiqEIQ41ErdfUUGBni\nCn4RKYmhF6QVMBMxETAPBgNVBAMMCG5ldzEudGxkggRZdxmGMB0GA1UdJQQWMBQG\nCCsGAQUFBwMBBggrBgEFBQcDAjCBkgYDVR0RBIGKMIGHgghuZXcxLnRsZIINbWFp\nbC5uZXcxLnRsZIIMd3d3Lm5ldzEudGxkgg9jcGFuZWwubmV3MS50bGSCEHdlYm1h\naWwubmV3MS50bGSCEHdlYmRpc2submV3MS50bGSCE2NwY29udGFjdHMubmV3MS50\nbGSCFGNwY2FsZW5kYXJzLm5ldzEudGxkMA0GCSqGSIb3DQEBCwUAA4IBAQCT4AQM\nwbwj3JEoQIJeP7RQyVe2/CPheqkSSajca1a3cUytwfRQ/m8DGM3L3WUZCaDEXYpJ\n+nt7k6KetL6Fs03e1W7IDADt68ahiBLIqvxEGZ5uNUYqOiEWgfp3yKEDOjkLLvzU\nGZb8FmNyeDoQ47b0mf0SRktG6W1rTMAg2kSDVoA7YNZStYvRzEliCX8cZqZ2as2d\nou95S+aGFAPJ+WMyYRgFm+ONAnpSbd9BursEcQSfLjKLusJzXrGVG9zZ/CAK2tHy\nXIlFrj88r0q9AZKyFkh6O1XvaZBiI/UEOWS2H3zcnh5ywudze7jTj5eFz5hr0ubX\ndji/LDNHmG+dKCK7\n-----END CERTIFICATE-----","nullable":"true","type":"string"},"is_self_signed":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the certificate is self-signed.\n* `1` - Self-signed.\n* `0` - **Not** self-signed."}}},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"SSL","type":"string"}}}}},"description":"HTTP Request was successful."}}}}}},"fetch_best_for_domain":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}],"paths":{"/SSL/fetch_best_for_domain":{"get":{"summary":"Request best SSL certificate","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  fetch_best_for_domain \\\n  domain='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/fetch_best_for_domain?domain=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_fetch_best_for_domain.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_fetch_best_for_domain.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/SSL/,\n    q/fetch_best_for_domain/,\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_fetch_best_for_domain.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_fetch_best_for_domain.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    'SSL',\n    'fetch_best_for_domain',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SSL","cPanel Account SSL Management"],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"properties":{"statusmsg":{"description":"The certificate's status.","example":"ok","type":"string"},"searched_users":{"items":{"type":"string","format":"username","example":"username"},"description":"The cPanel accounts that the system searched for domain information.","type":"array"},"user":{"type":"string","description":"The username that stores the private key.","format":"username","example":"username"},"crt":{"description":"The certificate's contents.","format":"pem-certificate","example":"-----BEGIN CERTIFICATE-----\nMIID/DCCAuSgZwBBAvIFANEXIaYwDQYJKoZIhvcNAQELBQAwFjEUMBIGA1UEAwwL\nZXhhbXBsZS5jb20wHhcNMjAwNDA2MTY0NDU2WhcNMjEwNDA2MTY0NDU2WjAWMRQw\nEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\nggEBALuCGWz/aFOr5TPBehISu3LkcGvnNFg9eY8rVXbNFfpBzyzdWrx5IiMtBcDx\nAZXMOU7GSZyFhSB6cjNfCaESXC/gBTa0sZ/b4b4etNUlNHUFAatb9WckQ6AtWbVA\npxu8aw/5AjAKgMbkaNrUY3vzLzin11CyGOFkbAKwVqT13Z3Yyz/xuz7x2+yMwPBh\n9mEP0tXjvCz7NzETFSTysn9Sf+VjUle0upnpl8Q7GK52CDpvwdqE/O6MrTx/XrXm\nYUfeSkZd+nqFm4oxmrf01hOL2IlEit1RupILwVm2/8CK2sAdazTqh4LapA962b9V\nSKm31YbsGT3kQg5EERbjIgiN6M8CAwEAAaOCAU8wggFLMB0GA1UdDgQWBBRhFUQb\nh7YE6tgcpiHke60td96d4zAJBgNVHRMEAjAAMEIGA1UdIwQ7MDmAFGEVRBuHtgTq\n2BymIeR7rS133p3joRqkGDAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbYIFANEXIaYw\nHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMIG7BgNVHREEgbMwgbCCC2V4\nYW1wbGUuY29tghBtYWlsLmV4YW1wbGUuY29tgg93d3cuZXhhbXBsZS5jb22CEmNw\nYW5lbC5leGFtcGxlLmNvbYITd2VibWFpbC5leGFtcGxlLmNvbYITd2ViZGlzay5l\neGFtcGxlLmNvbYIWY3Bjb250YWN0cy5leGFtcGxlLmNvbYIXY3BjYWxlbmRhcnMu\nZXhhbXBsZS5jb22CD3dobS5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEA\nT0TaI0ypM3eqtRSddgyoy5+nXi8a7a6xFKrwEAljBua3rNR6fOfedMOg9NFwCmQD\nw96/eZJjq+xMh57yLEGu05OBbyFVsdu2AXVhwHeBaURrGn5p7IjNMjdB+ld+oCmU\nex6iisbsfxwUqa7y2vqTU5XaUiXfccqEz8ofvuTcqNs8bgGn0Tm90XbgGnPVd7zl\nGm4t7Gf2pvMNd2R1prJ07z42bp/z8E2DcFhb/RPnblFOhJ8jPspxYK4G5XmwwYZD\n79NDK47OyG3hTiinxroKMjqIgnLT4ZabDMGHJkcg5xOL/VdYi7ZGHAnBEwA8eadO\ndh3jFPxGGIBJTTmKIScSbg==\n-----END CERTIFICATE-----","type":"string"},"ip":{"example":"192.168.0.1","format":"ipv4","description":"The IP address.","type":"string"},"domain":{"type":"string","example":"example.com","format":"domain","description":"The domain that generated the private key."},"crt_origin":{"format":"username","description":"The username that generated the certificate.","example":"username","type":"string"},"cab":{"type":"string","example":"-----BEGIN CERTIFICATE-----\nMIID/DCCAuSgZwBBAvIFANEXIaYwDQYJKoZIhvcNAQELBQAwFjEUMBIGA1UEAwwL\nZXhhbXBsZS5jb20wHhcNMjAwNDA2MTY0NDU2WhcNMjEwNDA2MTY0NDU2WjAWMRQw\nEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\nggEBALuCGWz/aFOr5TPBehISu3LkcGvnNFg9eY8rVXbNFfpBzyzdWrx5IiMtBcDx\nAZXMOU7GSZyFhSB6cjNfCaESXC/gBTa0sZ/b4b4etNUlNHUFAatb9WckQ6AtWbVA\npxu8aw/5AjAKgMbkaNrUY3vzLzin11CyGOFkbAKwVqT13Z3Yyz/xuz7x2+yMwPBh\n9mEP0tXjvCz7NzETFSTysn9Sf+VjUle0upnpl8Q7GK52CDpvwdqE/O6MrTx/XrXm\nYUfeSkZd+nqFm4oxmrf01hOL2IlEit1RupILwVm2/8CK2sAdazTqh4LapA962b9V\nSKm31YbsGT3kQg5EERbjIgiN6M8CAwEAAaOCAU8wggFLMB0GA1UdDgQWBBRhFUQb\nh7YE6tgcpiHke60td96d4zAJBgNVHRMEAjAAMEIGA1UdIwQ7MDmAFGEVRBuHtgTq\n2BymIeR7rS133p3joRqkGDAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbYIFANEXIaYw\nHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMIG7BgNVHREEgbMwgbCCC2V4\nYW1wbGUuY29tghBtYWlsLmV4YW1wbGUuY29tgg93d3cuZXhhbXBsZS5jb22CEmNw\nYW5lbC5leGFtcGxlLmNvbYITd2VibWFpbC5leGFtcGxlLmNvbYITd2ViZGlzay5l\neGFtcGxlLmNvbYIWY3Bjb250YWN0cy5leGFtcGxlLmNvbYIXY3BjYWxlbmRhcnMu\nZXhhbXBsZS5jb22CD3dobS5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEA\nT0TaI0ypM3eqtRSddgyoy5+nXi8a9a8xFKrwEAljBua3rNR6fOfedMOg9NFwCmQD\nw96/eZJjq+xMh57yLEGu05OBbyFVsdu2AXVhwHeBaURrGn5p7IjNM+dB+ld+oCnP\nex6iisbsfxwUqa7y2vqTU5XaUiXfccqEz8ofvuTcqNs8bgGn0Tm90XbgGnPVd7zl\nGm4t7Gf2pvMNd2R1prJ07z42bp/z8E2DcFhb/QZnblFOhJ8jPspxYK4G5XmwwYZD\n79NDK47OyG3hTiinxroKMjqIgnLT7ZabDMGHJkcg5xOL/VdYi7ZGHAnBEwA8eadO\ndh3jFPxGGIBJTTmKIScSrm==\n-----END CERTIFICATE-----","description":"The CA bundle's contents (if applicable).","format":"pem-certificate"},"status":{"type":"integer","description":"Whether the certificate is active.\n* `1` - Active.\n* `0` - Inactive.","example":"1","enum":["0","1"]},"key":{"type":"string","format":"pem-private-key","description":"The private key.","example":"-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBBCKAAQNAu4IZbP0oU6vlM8F6EhK9cuRrs+c1WD24jytPds0V+kH+LN1a\nvHkiIy0FwPABlcw5TrZJnIWFIHpyM18JoRJcM+AFNrSxn9vhvh601SU0dQUBq1v1\nZyRDoC1ZtUCnG7xrD/kCMAqAxuRo2tRje/MvOKfXULIY4WRsArBWpPXdndjLP/G7\nPvHb7IzA8GH2YQ/S1eO8LPs3MRMVJPKyf1J/5WNSV7S6memXxDsYrnYIOm/B2oT8\n7oytPH9eteZhR95KRl36eoWbijGat/TWE4vYiUSK3VG6kgvBWbb/wIrawB1rNOqH\ngtqkD3rZv1VIqbfVhuwZPeRCDkQRFuMiCI3ozwIDAQABAoIBAFADflIS0zQRQCdL\nwol/0NmAPbDt4lpdMUg0161wapZ2CrA8bQHMNxMHnVLuBR0lHrdMyhCusVZgqebe\nAT/ok8oiMFdd2AY9UCFO/R+PVskwr7ut7BRtVyY88/Dye9zMFGumeJaDhNxaj5wB\n0coMxfPJO4pF1XQo5CZplS+jc0RtiNnRmWP/zwwtH+QwT43GXKS3U3QgX1a/7Yzw\nliUFuggsjysNPovM5NzcgzYfVlMg3F9fDnMeve2s/MO6/wCIp1+SHN89DwluDmw0\nII0sJDtBRB1nPqseLV1XwYImdSosKuaUIK225vQy/cXK9S/zcq6+d6P5efCw8nRg\nbCfwd7ECgYEA8Agkx+P7zBAWItnkrNzah6QaWd3VP5bSw6WeHwcWIS1h3ASKSr3u\nT8rp5qDTk92eV/g5Uqr5lr8txnp448wnipeK0LDF4r+uhOsHOY4B4eFiTsRecXKD\nzlcC/ees4UOzbdptqosyAG5ub8UMwEH0zPOCszpnIhZkm004EHxc8zUCgYEAx/t0\nF1DYHm834CYyHfq3XiuB3yNECKMQZ1lgcq8IXaO3EJKnaSF3INogS1lZ6hQR2AW+\ntr+U6LdBRzsxH0ZeHu/lYCZ6ssgV3H6HTLlFVRysufVdlLaeaKAMuEADrUhVgvVA\n8rNM+8WSxrfya+2a/PwyJD9YdHCITcXVdwHHCHMCgYBLhYRtECJNVlJgrMXyTZrE\nSrGvzMgntcCiph1WDdi8n5bGrvcEBTZSDLoDQl7Pi08ixorio8Db2VMBu88FfVqD\nlKKsfrIEYeL7FyeyyCd3dn6D4e0FLM6jwWTDln0iczalPbB7lEgrMpO0vv8ADsCD\nK6rX1ZxZoWoOQwF8zmRAcQKBgQC85weoJpOfXAt5zlq1+ulPKOXKs3NGfVG3bjOp\n4SuT2FvKad19b0EqZSDzR/ylIkQgvHyD/8BXexNMh9tE4aFys8UF6BMq4dnUqCiC\nDtgxJ575IY8+NKq5xcV+HenbO2KbC7RIDZqAkQauc3+o947ZvhhXKQcTJmF6pY+Y\nlLM/hQKBgQCplo1rGsimNitBb2iw2B+jDJoMBLYjWeZWcr8VMwVlN9DXPG19uXKq\nCsbrteMX3VedbeRYk/NITsasRefZq7JDSe9JbsPxj3I+/nzV0EbMXX9cxJL3hkCc\n5QAmE/BMR7yh0odK57o+mcQZtecIEO1BK/qW6Au0otQHPraygGCwkQ==\n-----END RSA PRIVATE KEY-----"},"key_origin":{"example":"username","description":"The username that generated the private key.","format":"username","type":"string"}},"type":"object"},"metadata":{"properties":{}},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"}}},"module":{"example":"SSL","description":"The name of the module called.","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"fetch_best_for_domain"}}}}}}},"description":"This function retrieves the best-available certificate for the domain. The function also\nretrieves the certificate's associated private key and CA bundle, if available.\n\n**Important:**\n\nWhen you disable the [Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"fetch_best_for_domain","parameters":[{"in":"query","name":"domain","required":"true","description":"The domain name.","schema":{"type":"string","format":"domain","example":"example.com"}}]}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"start_autossl_check":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"openapi":"3.0.2","x-tagGroups":[{"tags":["Auto-generated SSL Certificates"],"name":"SSL Certificates"}],"paths":{"/SSL/start_autossl_check":{"get":{"summary":"Start AutoSSL for current user","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  start_autossl_check\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/start_autossl_check","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_start_autossl_check.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_start_autossl_check.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/SSL/,\n    q/start_autossl_check/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_start_autossl_check.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_start_autossl_check.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    'SSL',\n    'start_autossl_check'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SSL","Auto-generated SSL Certificates"],"x-cpanel-available-version":"cPanel 68","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"data":{"nullable":"true","default":null,"type":"object"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"enum":["1","0"],"example":"1","description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"func":{"description":"The name of the method called.","example":"start_autossl_check","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"start_autossl_check","description":"This function initiates an [AutoSSL](https://go.cpanel.net/whmdocsManageAutoSSL) check for the user.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, and  Web Server [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[]}}},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / Auto-generated SSL Certificates","name":"Auto-generated SSL Certificates"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}]},"delete_ssl":{"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}],"servers":[{"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."}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"paths":{"/SSL/delete_ssl":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"SSL"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"data":{"default":null,"nullable":"true","type":"object"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"An array containing a message about the domain's SSL removal.","example":["The SSL host was successfully removed."]},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}}},"func":{"example":"delete_ssl","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"name":"domain","in":"query","required":"true","description":"The domain name.","schema":{"example":"example.com","format":"domain","type":"string"}}],"description":"This function removes SSL from a domain.\n\n**Note:**\n\nThis function removes domains from the current certificate to end SSL coverage for those\ndomains. To delete certificates from SSL storage, use the UAPI function `SSL::delete_cert`\ninstead.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, **and** Web Server\n[roles](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"delete_ssl","summary":"Remove SSL for domain","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  delete_ssl \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/delete_ssl?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_delete_ssl.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_delete_ssl.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/SSL/,\n    q/delete_ssl/,\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_delete_ssl.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_delete_ssl.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    'SSL',\n    'delete_ssl',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["SSL","cPanel Account SSL Management"]}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}}},"set_default_key_type":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}],"paths":{"/SSL/set_default_key_type":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"SSL","description":"The name of the module called.","type":"string"},"func":{"example":"set_default_key_type","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 92","parameters":[{"example":"ecdsa-prime256v1","description":"The key type to set.\n\n* `system` — Use the system’s `ssl_default_key_type` value.\n* `rsa-2048` — 2,048-bit RSA.\n* `rsa-4096` — 4,096-bit RSA.\n* `ecdsa-prime256v1` — ECDSA prime256v1 (“P-256”).\n* `ecdsa-secp384r1` — ECDSA secp384r1 (“P-384”).","schema":{"enum":["system","rsa-2048","rsa-4096","ecdsa-prime256v1","ecdsa-secp384r1"],"type":"string"},"in":"query","name":"type","required":"true"}],"description":"This function sets a user’s preferred SSL/TLS key type.","operationId":"SSL::set_default_key_type","summary":"Update SSL TLS key type","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  set_default_key_type \\\n  type='ecdsa-prime256v1'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/set_default_key_type?type=ecdsa-prime256v1"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_set_default_key_type.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_set_default_key_type.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/SSL/,\n    q/set_default_key_type/,\n    {\n        'type' => 'ecdsa-prime256v1',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_set_default_key_type.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_set_default_key_type.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    'SSL',\n    'set_default_key_type',\n    array (\n        'type' => 'ecdsa-prime256v1',\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}"}],"tags":["SSL","cPanel Account SSL Management"]}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}]},"list_certs":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/SSL/list_certs":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"data":{"items":{"type":"object","properties":{"subject_text":{"description":"The certificate's subject text information.","example":"commonName\nwww.example.com","type":"string"},"domains":{"type":"array","description":"A list of domains that the certificate covers.","items":{"example":"example.com","type":"string"}},"created":{"type":"integer","description":"The date the certificate was created.","format":"unix_timestamp","example":"1569884400"},"is_self_signed":{"description":"Whether the certificate is self-signed.\n\n* `1` — Self-signed.\n* `0` — Not self-signed.","example":"1","enum":["1","0"],"type":"integer"},"key_algorithm":{"type":"string","description":"The certificate's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"]},"subject.commonName":{"type":"string","description":"The certificate's Common Name (CN).","example":"example.com"},"issuer.organizationName":{"example":"Organization","description":"The certificate's organization.","type":"string"},"domain_is_configured":{"description":"Whether the certificate is installed on the account.\n\n* `1` — Installed.\n* `0` — Not installed.","enum":["1","0"],"example":"1","type":"integer"},"friendly_name":{"example":"TestCert","description":"The certificate's friendly name.","type":"string"},"not_before":{"type":"integer","format":"unix_timestamp","description":"The certificate's start date.","example":"1569844800"},"validation_type":{"type":"string","nullable":"true","description":"The certificate's validation type.\n\n* `ev` — Extended Validation.\n* `ov` — Organization Validation.\n* `dv` — Domain Validation.\n* `null` — The system could not parse and determine the\ncertificate's validation type.","example":"dv","enum":["ev","ov","dv"]},"ecdsa_public":{"type":"string","nullable":"true","description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an ECDSA key.","example":null},"issuer.commonName":{"example":"example.com","description":"The issuer's name.","type":"string"},"signature_algorithm":{"example":"sha256WithRSAEncryption","description":"The OID hash algorithm signature of the certificate.","type":"string"},"issuer_text":{"description":"The certificate's issuer information.","example":"countryName\nUS\nstateOrProvinceName\nTX\nlocalityName\nHouston\norganizationName\nWebPros International, LLC\ncommonName\nWebPros International, LLC Certification Authority","type":"string"},"modulus":{"type":"string","nullable":"true","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","description":"The certificate's key's modulus, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an RSA key."},"ecdsa_curve_name":{"example":null,"enum":["prime256v1","secp384r1"],"description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key.","nullable":"true","type":"string"},"modulus_length":{"nullable":"true","description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"2048","type":"integer"},"serial":{"example":"45462cd0d6537b20cf2f3eb8aec07140","description":"The certificate's serial number.","type":"string"},"id":{"type":"string","example":"example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041","description":"The certificate's ID."},"not_after":{"type":"integer","example":"1601467200","description":"The certificate's expiration date.","format":"unix_timestamp"}}},"type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"SSL","description":"The name of the module called."},"func":{"description":"The name of the method called.","example":"list_certs","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[],"operationId":"list_certs","description":"This function lists an account's certificates.\n\n**Important:**\n\nWhen you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail,\nand Web Server [roles](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","summary":"Return all SSL certificates","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  list_certs\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/list_certs","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_list_certs.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_list_certs.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/SSL/,\n    q/list_certs/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_list_certs.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_list_certs.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    'SSL',\n    'list_certs'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["SSL","cPanel Account SSL Management"]}}},"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}]},"set_csr_friendly_name":{"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / SSL Certificate Management","name":"SSL Certificate Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"tags":["SSL Certificate Management"],"name":"SSL Certificates"}],"paths":{"/SSL/set_csr_friendly_name":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  set_csr_friendly_name \\\n  friendly_name='TestCSR' \\\n  id='example_com_eda9d_543fb_a3009b4b01a592390866ab3a47c0df18' \\\n  new_friendly_name='TestCSR2'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/set_csr_friendly_name?friendly_name=TestCSR&id=example_com_eda9d_543fb_a3009b4b01a592390866ab3a47c0df18&new_friendly_name=TestCSR2"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_set_csr_friendly_name.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_set_csr_friendly_name.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/SSL/,\n    q/set_csr_friendly_name/,\n    {\n        'friendly_name' => 'TestCSR',\n        'id' => 'example_com_eda9d_543fb_a3009b4b01a592390866ab3a47c0df18',\n        'new_friendly_name' => 'TestCSR2',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_set_csr_friendly_name.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_set_csr_friendly_name.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    'SSL',\n    'set_csr_friendly_name',\n    array (\n        'friendly_name' => 'TestCSR',\n        'id' => 'example_com_eda9d_543fb_a3009b4b01a592390866ab3a47c0df18',\n        'new_friendly_name' => 'TestCSR2',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["SSL","SSL Certificate Management"],"summary":"Update certificate signing request's friendly name","x-cpanel-api-version":"UAPI","operationId":"set_csr_friendly_name","description":"This function changes a certificate signing request's (CSR) friendly name.\n\n**Important:**\n\n* You **must** call either the `friendly_name` or `id` parameter.\n* When you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"required":"true","name":"friendly_name","in":"query","schema":{"type":"string","example":"TestCSR"},"description":"The CSR's friendly name."},{"in":"query","name":"id","required":"true","description":"The CSR's ID.\n\n**Note:**\n\nTo retrieve a CSR's ID, use the UAPI `list_csrs` function.","schema":{"type":"string","example":"example_com_eda9d_543fb_a3009b4b01a592390866ab3a47c0df18"}},{"in":"query","name":"new_friendly_name","required":"true","description":"The CSR's new friendly name.","schema":{"type":"string","example":"TestCSR2"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"set_csr_friendly_name","description":"The name of the method called."},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"default":null,"nullable":"true","type":"object"},"metadata":{"properties":{}}}},"module":{"example":"SSL","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}}}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"find_certificates_for_key":{"x-tagGroups":[{"name":"SSL Certificates","tags":["cPanel Account SSL Management"]}],"paths":{"/SSL/find_certificates_for_key":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return SSL certificate for private key","tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  find_certificates_for_key\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/find_certificates_for_key","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_find_certificates_for_key.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_find_certificates_for_key.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/SSL/,\n    q/find_certificates_for_key/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_find_certificates_for_key.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_find_certificates_for_key.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    'SSL',\n    'find_certificates_for_key'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"find_certificates_for_key","type":"string"},"module":{"description":"The name of the module called.","example":"SSL","type":"string"},"result":{"type":"object","properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"type":"array","items":{"type":"object","properties":{"domains":{"type":"array","items":{"format":"domain","example":"example.com","type":"string"},"description":"A list of the domains that the certificate covers."},"subject_text":{"example":"countryName\nUS\ncommonName\u001bxample.com\nlocalityName\nHouston\norganizationName\ncPanel\nstateOrProvinceName\ntx","description":"The certificate's subject text information.","type":"string"},"is_self_signed":{"type":"integer","example":"1","enum":["1","0"],"description":"Whether the certificate is self-signed.\n\n* `1` — Self-signed.\n* `0` — Not self-signed."},"created":{"type":"integer","description":"The date the certificate was created.","format":"unix_timestamp","example":"1538308800"},"issuer.organizationName":{"type":"string","example":"The Example Organization","description":"The certificate's organization name."},"subject.commonName":{"example":"example.com","description":"The certificate's Common Name.","type":"string"},"key_algorithm":{"type":"string","description":"The certificate's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA.","example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"]},"friendly_name":{"type":"string","example":"TestCert","description":"The certificate's friendly name."},"issuer_text":{"type":"string","example":"countryName\nUS\ncommonName\u001bxample.com\nlocalityName\nHouston\norganizationName\ncPanel\nstateOrProvinceName\ntx","description":"The certificate's issuer information."},"signature_algorithm":{"description":"The certificate's signature OID hash algorithm.","example":"sha256WithRSAEncryption","type":"string"},"ecdsa_public":{"type":"string","example":null,"description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an ECDSA key.","nullable":"true"},"validation_type":{"type":"string","enum":["ev","ov","dv"],"example":"dv","description":"The certificate's validation type.\n\n* `ev` — Extended Validation.\n* `ov` — Organization Validation.\n* `dv` — Domain Validation.\n* `null` — The system could not parse and determine the\ncertificate's validation type.","nullable":"true"},"issuer.commonName":{"type":"string","description":"The name that issued the certificate.","example":"example.com"},"not_before":{"type":"integer","example":"1538308800","format":"unix_timestamp","description":"The date the certificate started."},"id":{"example":"example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff","description":"The certificate's ID.","type":"string"},"modulus_length":{"nullable":"true","description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"2048","type":"integer"},"ecdsa_curve_name":{"type":"string","nullable":"true","example":null,"enum":["prime256v1","secp384r1"],"description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key."},"modulus":{"description":"The certificate's key's modulus, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","nullable":"true","type":"string"},"not_after":{"type":"integer","example":"1569844800","description":"The date the certificate expired.","format":"unix_timestamp"}}}},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}}}},"description":"This function retrieves SSL certificates for a private key.\n\n**Note:**\n\nWhen you call this function, you **must** include either the `id`\n**or** the `friendly_name` parameter.","operationId":"find_certificates_for_key","parameters":[{"required":"false","name":"id","in":"query","schema":{"type":"string","example":"example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3"},"description":"The key's ID."},{"description":"The key's friendly name.","schema":{"type":"string","example":"TestKey"},"in":"query","name":"friendly_name","required":"false"}]}}},"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"description":"SSL Certificates / cPanel Account SSL Management","name":"cPanel Account SSL Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"rebuild_mail_sni_config":{"x-tagGroups":[{"tags":["SNI Email Settings"],"name":"SSL Certificates"}],"paths":{"/SSL/rebuild_mail_sni_config":{"get":{"x-cpanel-api-version":"UAPI","summary":"Start SNI configuration files rebuild","tags":["SSL","SNI Email Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  rebuild_mail_sni_config\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/rebuild_mail_sni_config"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_rebuild_mail_sni_config.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_rebuild_mail_sni_config.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/SSL/,\n    q/rebuild_mail_sni_config/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_rebuild_mail_sni_config.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_rebuild_mail_sni_config.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    'SSL',\n    'rebuild_mail_sni_config'\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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"rebuild_mail_sni_config","description":"The name of the method called."},"result":{"properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"properties":{"success":{"description":"Whether the system rebuilt the configuration files.\n* `1` - Configuration files rebuilt.\n* `0` - Configuration files **not** rebuilt.","example":"1","enum":["0","1"],"type":"integer"}},"type":"object"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"SSL","description":"The name of the module called."}}}}}}},"x-cpanel-available-version":"cPanel 11.48","parameters":[{"name":"reload_dovecot","in":"query","required":"false","description":"Whether to reload the Dovecot service after the system rebuilds\nthe configuration files.\n* `1` - Reload Dovecot.\n* `0` - Do **not** reload Dovecot.","schema":{"type":"integer","default":"1","enum":["0","1"],"example":"1"}}],"operationId":"rebuild_mail_sni_config","description":"This function rebuilds the SNI configuration files.\n\n**Note:**\n\n* You **must** run this function after you change the SNI status through the UAPI's `enable_mail_sni` or `disable_mail_sni` functions.\n* Mail SNI is **always** enabled.\n  * Functions that enable Mail SNI succeed with a warning that Mail SNI is always enabled. Functions that disable Mail SNI fail and make no changes.\n  * Functions that disable Mail SNI will fail and make no changes.\n\n**Important:**\n\n When you disable the _Calendars and Contacts_, _Receive Mail_, _Web Disk_, _Webmail_, **and**  _Web Server_ [roles](https://go.cpanel.net/serverroles), the system **disables** this function."}}},"tags":[{"description":"The SSL module for UAPI.","name":"SSL"},{"name":"SNI Email Settings","description":"SSL Certificates / SNI Email Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"installed_hosts":{"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"SSL","description":"The SSL module for UAPI."},{"name":"cPanel Account SSL Management","description":"SSL Certificates / cPanel Account SSL Management"}],"paths":{"/SSL/installed_hosts":{"get":{"operationId":"installed_hosts","description":"This function retrieves a list of the account's websites, their domains, and certificate information.\n\n**Important:**\n\n  For a dedicated IP address, use the UAPI `SSL::installed_host` function.\n\n**Important:**\n\n When you disable the *CalendarContact* , *MailReceive* , *WebDisk* , *Webmail* , and  *WebServer* [roles](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"installed_hosts"},"module":{"type":"string","description":"The name of the module called.","example":"SSL"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"data":{"properties":{},"type":"array","items":{"properties":{"needs_sni":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the website requires SNI to function.\n* `1` - Requires SNI.\n* `0` - Does not require SNI."},"ip":{"oneOf":[{"format":"ipv4","type":"string"},{"type":"string","format":"ipv6"}],"description":"The host's IP address.","example":"192.168.0.1"},"domains":{"type":"array","items":{"format":"domain","example":"example.com","type":"string"},"description":"The domains that the certificate covers."},"certificate":{"description":"An object that contains information about each certificate.","type":"object","properties":{"subject_text":{"type":"string","example":"commonName\nexample.com","description":"The subject's X.509 information."},"domains":{"items":{"format":"domain","example":"example.com","type":"string"},"description":"The domains that the certificate covers.","type":"array"},"auto_ssl_provider_display_name":{"type":"string","description":"The AutoSSL provider's display name.","example":"Sectigo"},"key_algorithm":{"type":"string","example":"rsaEncryption","enum":["rsaEncryption","id-ecPublicKey"],"description":"The certificate's key's algorithm.\n\n* `rsaEncryption` — RSA.\n* `id-ecPublicKey` — ECDSA."},"issuer.organizationName":{"example":"The Example Organization","description":"The certificate's organization name.","type":"string"},"auto_ssl_provider":{"type":"string","example":"cPanel","description":"The AutoSSL provider's name."},"subject.commonName":{"format":"domain","description":"The certificate's common name.","example":"example.com","type":"string"},"is_self_signed":{"type":"integer","description":"Whether the certificate is self-signed.\n* `1` - Self-signed.\n* `0` - Not self-signed.","enum":["0","1"],"example":"1"},"validation_type":{"type":"string","nullable":"true","example":"dv","enum":["ev","ov","dv"],"description":"The certificate's validation type.\n\n**Note:**\n* `ev` -  Extended Validation.\n* `ov` - Organization Validation.\n* `dv` - Domain Validation.\n* null - The system could not parse and determine the certificate's validation type."},"issuer.commonName":{"type":"string","description":"The name that issued the certificate.","format":"domain","example":"example.com"},"ecdsa_public":{"nullable":"true","description":"The certificate's key's ECDSA compressed public point, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an ECDSA key.","example":null,"type":"string"},"not_before":{"type":"integer","format":"unix_timestamp","description":"When the certificate started.","example":"1415123822"},"issuer_text":{"type":"string","description":"The issuer's X.509 information.","example":"example.com\ncountryName\nUS\nemailAddress\nusername@example.com\norganizationName\nExample\nstateOrProvinceName\nTexas\nlocalityName\nHouston"},"signature_algorithm":{"example":"sha256WithRSAEncryption","description":"The signature algorithm of the certificate.","format":"sha256","type":"string"},"not_after":{"description":"When the certificate expired.","format":"unix_timestamp","example":"1446659822","type":"integer"},"is_autossl":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the AutoSSL service provided the certificate.\n* `1` - Provided by the AutoSSL service.\n* `0` - Not provided by the AutoSSL service."},"ecdsa_curve_name":{"type":"string","example":null,"enum":["prime256v1","secp384r1"],"description":"The ECDSA curve that the certificate's key uses.\n\n* `prime256v1`\n* `secp384r1`\n* `null` — The certificate's key is **not** an ECDSA key.","nullable":"true"},"modulus":{"nullable":"true","format":"hex","description":"The certificate's key's modulus, in hexadecimal format.\n\n* `null` — The certificate's key is **not** an RSA key.","example":"a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db","type":"string"},"id":{"description":"The certificate's ID.","example":"example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff","type":"string"},"modulus_length":{"type":"integer","minimum":"1","nullable":"true","example":"2048","description":"The length, in bits, of the certificate's key's modulus.\n\n* `null` — The certificate's key is **not** an RSA key."}}},"certificate_text":{"type":"string","example":"-----BEGIN CERTIFICATE-----\nMIIDcTCCAlmgAwIBAgIFAU+BNVgwDQYJKoZIhvcNAQEFBQAwUTESMBAGA1UEAwwJ\nc2lza28udGxkMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGY1BhbmVsMQswCQYDVQQI\nDAJUWDEQMA4GA1UEBwwHSG91c3RvbjAeFw0xNDEwMDYyMjI2MTlaFw0xNTEwMDYy\nMjI2MTlaMFExEjAQBgNVBAMMCXNpc2tvLnRsZDELMAkGA1UEBhMCVVMxDzANBgNV\nBAoMBmNQYW5lbDELMAkGA1UECAwCVFgxEDAOBgNVBAcMB0hvdXN0b24wggEiMA0G\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9zx6zGiHdmWA0dKtoXmJiWXpZ9E3P\nXx3YHsjFEWW7e5pH0vZ+jVMzDmm5nsJ7RXrAkZO1IvpIpVLvoQfiJOWVvkD+o9fW\nvoK1tWJS72FSgPju+58mA2ieBuc87A790Pzuv1P3NR3zFLAjUR99zkHR1fpri/da\nM3PBWO8ET48FWkyU1kOeZaUlF67/+wrEiNgg+t1qhKOCAB61PdNVkLaSGHimksuC\n+Czk8Kq9nuS0E0TCnDtjjEyJ455FUcaCfczlTb8xkB/F9ORe74yTzD+vlk0tFMG6\nPLj/ajIwWqwO0qmQ8wX3NRxkWgGz5kVO1wrVJarKQ5EYQ3/mgvit0v6dAgMBAAGj\nUDBOMB0GA1UdDgQWBBRw+wKBo34+bgexjAa3EMDsgSCd7zAfBgNVHSMEGDAWgBRw\n+wKBo34+bgexjAa3EMDsgSCd7zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA\nA4IBAQCHRXIs53opzKM2rM8Qe8lcw524WK6hqy2EWrZHp78N7rU7/6DQ/I3hv3Wh\ncDDIO04I2/Xhe88MLBaLoM367Ya+vy7CaLr14aLi/SfQszMA0ALBvMao+Fis0iVw\nFYq/NLgSXw+fgnpFskt8v8iQZ+4Kaal8U8e9sVgu8m0RgO7rzym1eRiIKpsKd1rh\n/SD7LbSN7M7TRL3QqF7ltw9sQhAAsQcRaBBF21pdWrqhiGZ+Eioo3hhgwNavH2ag\nqz78ddHwrFpHFwrEeUk1OfpPb76MYIce7xIy/4oQNdg6fOq4l/FrajBv+WkzDVPa\nKm6r7YmwfLN/YMZBHXSR58oOGP9W\n-----END CERTIFICATE-----","format":"pem-certificate","description":"The certificate's text."},"mail_sni_status":{"enum":["0","1"],"example":"1","description":"Whether SNI is active on the domain.\n* `1` - Active.\n* `0` - Inactive.","type":"integer"},"fqdns":{"description":"An array of every valid fully qualified domain\nname (FQDN) on the virtual host, which includes service\nsubdomains (proxy subdomains).","items":{"type":"string","format":"domain","example":"www.example.com"},"type":"array"},"is_primary_on_ip":{"description":"Whether the website is primary on the IP address.\n* `1` - Primary.\n* `0` - Not primary.","example":"1","enum":["0","1"],"type":"integer"},"servername":{"type":"string","format":"domain","description":"The server's hostname.","example":"example.com"},"docroot":{"type":"string","example":"/home/username/public_html","description":"The document root of the domain that the certificate covers.","format":"path"}},"type":"object"}},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}}}},"type":"object"}}}}},"tags":["SSL","cPanel Account SSL Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSL \\\n  installed_hosts\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSL/installed_hosts"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSL_installed_hosts.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSL_installed_hosts.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/SSL/,\n    q/installed_hosts/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSL_installed_hosts.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSL_installed_hosts.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    'SSL',\n    'installed_hosts'\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","summary":"Return domains with SSL certificate information"}}},"x-tagGroups":[{"tags":["cPanel Account SSL Management"],"name":"SSL Certificates"}],"openapi":"3.0.2","info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}}},"SpamAssassin":{"get_symbolic_test_names":{"x-tagGroups":[{"tags":["Spam Management"],"name":"Email"}],"paths":{"/SpamAssassin/get_symbolic_test_names":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return SpamAssassin™ symbolic test scores","tags":["SpamAssassin","Spam Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SpamAssassin \\\n  get_symbolic_test_names\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SpamAssassin/get_symbolic_test_names","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SpamAssassin_get_symbolic_test_names.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SpamAssassin_get_symbolic_test_names.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/SpamAssassin/,\n    q/get_symbolic_test_names/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SpamAssassin_get_symbolic_test_names.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SpamAssassin_get_symbolic_test_names.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    'SpamAssassin',\n    'get_symbolic_test_names'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-available-version":"cPanel 70","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{},"messages":{},"func":{"example":"get_symbolic_test_names","description":"The name of the method called.","type":"string"},"module":{"example":"SpamAssassin","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"data":{"type":"array","items":{"properties":{"score":{"description":"The score to assign to the email if the result of the test is true.","example":"1","oneOf":[{"type":"number"},{"type":"integer"}]},"key":{"type":"string","example":"ACT_NOW_ALL_CAPS","description":"The name of the test."},"rule_type":{"enum":["body_tests","full_evals","head_evals","head_tests","meta_tests","other_tests","rawbody_tests","uri_tests"],"example":"body_tests","description":"The type and section of the email that the SpamAssassin analyses.\n* `body_tests`\n* `full_evals`\n* `head_evals`\n* `head_tests`\n* `meta_tests`\n* `other_tests`\n* `rawbody_tests`\n* `uri_tests`","type":"string"}},"type":"object"}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"errors":{}}}}},"description":"HTTP Request was successful."}},"description":"This function lists the Apache SpamAssassin™ scores for each symbolic test.","operationId":"get_symbolic_test_names","parameters":[]}}},"tags":[{"name":"SpamAssassin","description":"The SpamAssassin module for UAPI."},{"name":"Spam Management","description":"Email / Spam Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2"},"update_user_preference":{"paths":{"/SpamAssassin/update_user_preference":{"get":{"operationId":"update_user_preference","description":"This function sets the Apache SpamAssassin™ settings for the account.\n\n**Note:**\n\nAdditional customizations may appear in the function's return. For more information,\nread the [Apache SpamAssassin configuration file documentation](https://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Conf.html#user_preferences).","parameters":[{"description":"The variable that you want to manipulate.\n\n* `score`\n* `required_score`\n* `whitelist_from`\n* `blacklist_from`\n* A [custom SpamAssassin variable](https://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Conf.html#user_preferences).\n\n**Important:**\n\n* You can **only** choose one of these possible values per call.\n* If you enter a value for the `preference` parameter, but you do **not** define a value for the `value` parameter, the function will remove any previous settings.","example":"score","schema":{"type":"string"},"name":"preference","in":"query","required":"true"},{"required":"false","in":"query","name":"value","schema":{"type":"string","example":"ACT_NOW_CAPS 5.0"},"description":"The value for the preference of the variable that you want to manipulate.\n\n* A valid SpamAssassin \"`TEST_NAME SCORE`\" value when the value of the `preference` parameter is `score`, where:\n\n    * `TEST_NAME` represents the symbolic name of the test. For list of symbolic test names, run the UAPI `SpamAssassin::get_symbolic_test_names` function.\n    * `SCORE` represents the floating-point value that SpamAssassin assigns to the mail when the test result is true. The score value must be greater than `0`, and less than `1000`.\n\n* A valid floating-point number if the value of the `preference` parameter is `required_score`.\n* A valid email address if the value of the `preference` parameter is `whitelist_from` or `blacklist_from`.\n* A [custom SpamAssassin variable](https://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Conf.html#user_preferences) value.\n\n**Note:**\n\nTo enter multiple values, increment the parameter name. For example, use the `value-0` and `value-1` parameters.","examples":{"single":{"summary":"Define a single variable value.","value":"ACT_NOW_CAPS 5.0"},"multiple":{"value":"value-0=ACT_NOW_CAPS 5.0 value-1=INVALID_DATE 3.2","summary":"Define multiple variable values."}}}],"x-cpanel-available-version":"cPanel 70","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"SpamAssassin"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"blacklist_from":{"description":"An array of email addresses on the blacklist.","items":{"example":"username2@example.com","format":"email","type":"string"},"type":"array"},"whitelist_from":{"type":"array","description":"An array of the email addresses on the whitelist.","items":{"example":"username@example.com","format":"email","type":"string"}},"score":{"type":"array","items":{"type":"string","example":"ACT_NOW_CAPS 5"},"description":"An array of the symbolic test names and their scores."},"additionalProperties":{"items":{"example":"mycustomscore","type":"string"},"description":"An array containing custom SpamAssassin variable values.\n\n**Note:**\n\nThe array's name is the custom SpamAssassin variable's name."},"required_score":{"description":"An array containing the score at which the system will mark a message as spam. The system considers mail that matches this score to be spam.","items":{"example":"5","format":"float","type":"number"},"type":"array"}},"example":{"blacklist_from":["username2@example.com"],"whitelist_from":["username@example.com"],"score":["ACT_NOW_CAPS 5"],"required_score":["5"],"ok_locales":["all"]}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","nullable":"true"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"description":"The name of the method called.","example":"update_user_preference","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SpamAssassin \\\n  update_user_preference \\\n  preference='score'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SpamAssassin/update_user_preference?preference=score","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SpamAssassin_update_user_preference.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SpamAssassin_update_user_preference.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/SpamAssassin/,\n    q/update_user_preference/,\n    {\n        'preference' => 'score',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SpamAssassin_update_user_preference.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SpamAssassin_update_user_preference.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    'SpamAssassin',\n    'update_user_preference',\n    array (\n        'preference' => 'score',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SpamAssassin","Spam Management"],"summary":"Update SpamAssassin™ settings","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Spam Management"],"name":"Email"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The SpamAssassin module for UAPI.","name":"SpamAssassin"},{"name":"Spam Management","description":"Email / Spam Management"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"clear_spam_box":{"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The SpamAssassin module for UAPI.","name":"SpamAssassin"},{"name":"Spam Management","description":"Email / Spam Management"}],"paths":{"/SpamAssassin/clear_spam_box":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"clear_spam_box","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"SpamAssassin"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"metadata":{"properties":{}}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 70","parameters":[],"operationId":"clear_spam_box","description":"This function clears the spam box of all its contents for all email accounts.\n\n**Important:**\n\nThis function deletes the Spam Box folder contents for every email address on the account, which includes the system user email account.","summary":"Delete spam box contents","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SpamAssassin \\\n  clear_spam_box\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SpamAssassin/clear_spam_box"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SpamAssassin_clear_spam_box.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SpamAssassin_clear_spam_box.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/SpamAssassin/,\n    q/clear_spam_box/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SpamAssassin_clear_spam_box.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SpamAssassin_clear_spam_box.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    'SpamAssassin',\n    'clear_spam_box'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SpamAssassin","Spam Management"]}}},"x-tagGroups":[{"tags":["Spam Management"],"name":"Email"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"get_user_preferences":{"x-tagGroups":[{"name":"Email","tags":["Spam Management"]}],"paths":{"/SpamAssassin/get_user_preferences":{"get":{"x-cpanel-available-version":"cPanel 70","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"SpamAssassin","description":"The name of the module called."},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"blacklist_from":{"description":"The email addresses on the blacklist.","items":{"type":"string","example":"username2@example.com","format":"email"},"type":"array"},"whitelist_from":{"description":"The email addresses on the whitelist.","items":{"format":"email","example":"username@example.com","type":"string"},"type":"array"},"score":{"type":"array","description":"The symbolic test name and score.","items":{"type":"string","example":"ACT_NOW_CAPS 1"}},"required_score":{"type":"array","items":{"type":"number","example":"5.1","format":"float"},"description":"The score to mark a message as spam. The system considers mail that matches this score to be spam."}}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the `errors` field for more details."},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","example":"get_user_preferences","description":"The name of the method called."}}}}}}},"description":"This function lists the Apache SpamAssassin™ settings for the account.\n\n**Note:**\n\nAdditional customizations may appear in the returns. Form more information read the [Apache SpamAssassin™ configuration file](https://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Conf.html#user_preferences) documentation.","operationId":"get_user_preferences","parameters":[],"summary":"Return SpamAssassin™ settings","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SpamAssassin \\\n  get_user_preferences\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/SpamAssassin/get_user_preferences"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SpamAssassin_get_user_preferences.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SpamAssassin_get_user_preferences.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/SpamAssassin/,\n    q/get_user_preferences/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SpamAssassin_get_user_preferences.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SpamAssassin_get_user_preferences.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    'SpamAssassin',\n    'get_user_preferences'\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}"}],"tags":["SpamAssassin","Spam Management"]}}},"tags":[{"name":"SpamAssassin","description":"The SpamAssassin module for UAPI."},{"description":"Email / Spam Management","name":"Spam Management"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}}},"Leika":{"leika_get_config":{"paths":{"/Leika/leika_get_config":{"get":{"parameters":[{"required":"false","in":"query","name":"item","schema":{"type":"string"},"examples":{"cpanel.key1":{"value":"cpanel.key1","description":"Return the `key1` configuration key for the `cpanel` feature."},"webmail.key3.subkey1":{"value":"webmail.key3.subkey1","description":"Return the nested `key3.subkey1` configuration key for the `webmail` feature."}},"description":"\nThe feature(s) for which to return configuration keys.\n\n**Note:**\n\n  * Pass multiple `item` parameters to return multiple features' configuration keys.\n  * If an `item` parameter returns an `undefined` key value, the configuration value does not exist or is set to `null`."}],"operationId":"leika_get_config","description":"\nThis function returns Leika configuration data. Leika is an internal module that cPanel & WHM uses to track access to features.\n\n**Note:**\n\nIf you do not provide an `item` parameter, this returns the **entire** configuration.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Leika"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1","type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"type":"object","description":"The requested configuration data.","example":{"cpanel.key1":"enabled","webmail.key3":{"subkey2":"inactive","subkey1":"active"}}},"metadata":{"properties":{}}}},"func":{"description":"The name of the method called.","example":"leika_get_config","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"11.32","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi Leika leika_get_config item='key1' item='key3'\nuapi --output=jsonpretty \\\n--user=username \\\nLeika \\\nleika_get_config \\\nitem=cpanel.key1 \\\nitem=webmail.key3\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Leika/leika_get_config?item=cpanel.key1&item=webmail.key3\n"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Leika_leika_get_config.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Leika_leika_get_config.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/Leika/,\n    q/leika_get_config/,\n    q/item=cpanel.key1/,\n    q/item=webmail.key3/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Leika_leika_get_config.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Leika_leika_get_config.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    'Leika',\n    'leika_get_config',\n    array('item' => 'cpanel.key1', 'item' => 'webmail.key3')\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Leika","Account Management"],"summary":"Return Leika configuration","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Account Management"],"name":"cPanel Account"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Leika module for cPanel UAPI.","name":"Leika"},{"description":"cPanel Account / Account Management","name":"Account Management"}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"version":"11.97.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"Return Leika configuration"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}}},"VersionControl":{"delete":{"tags":[{"name":"VersionControl","description":"The VersionControl module for UAPI."},{"name":"Repository Management","description":"GIT Management / Repository Management"}],"servers":[{"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."}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"GIT Management","tags":["Repository Management"]}],"paths":{"/VersionControl/delete":{"get":{"x-cpanel-api-version":"UAPI","summary":"Delete Git repository","tags":["VersionControl","Repository Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  VersionControl \\\n  delete \\\n  repository_root='/home/user/example'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/VersionControl/delete?repository_root=%2fhome%2fuser%2fexample","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file VersionControl_delete.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/VersionControl_delete.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/VersionControl/,\n    q/delete/,\n    {\n        'repository_root' => '/home/user/example',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file VersionControl_delete.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/VersionControl_delete.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    'VersionControl',\n    'delete',\n    array (\n        'repository_root' => '/home/user/example',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 72","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"VersionControl","description":"The name of the module called."},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"func":{"description":"The name of the method called.","example":"delete","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function deletes a cPanel account's Git™ repository. For more information about\nsupport for version control in cPanel & WHM, read our\n[Git Version Control](https://go.cpanel.net/GitVersionControl) and\n[Guide to Git](https://go.cpanel.net/GitDeployment) documentation.\n\n**Warning:**\n\n* When you call this function, the system **permanently deletes** the entire contents\nof the specified directory. You **cannot** recover this data after deletion.\n* You **cannot** use this function to delete any repositories that do not appear in\nthe cache of repositories (for example, repositories that contain invalid characters or\nexist within cPanel-controlled directories).","operationId":"VersionControl::delete","parameters":[{"description":"The absolute directory path in the user's `home` directory containing the repository to delete.","schema":{"example":"/home/user/example","type":"string"},"name":"repository_root","in":"query","required":"true"}]}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}}},"create":{"x-tagGroups":[{"name":"GIT Management","tags":["Repository Management"]}],"paths":{"/VersionControl/create":{"get":{"x-cpanel-available-version":"cPanel 72","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"data":{"properties":{"available_branches":{"type":"array","items":{"type":"string"},"description":"An list of available branches for the cloned or existing repository, if any exist.","example":["master","olive"]},"branch":{"nullable":"true","example":"master","description":"The repository's current branch.\n\n* `null` — The system has **not** finished the clone process for\nthe repository, or no local branches exist.","type":"string"},"name":{"example":"example","description":"The repository's display name.","type":"string"},"repository_root":{"type":"string","description":"The absolute path of the directory that contains the repository in the user's `home` directory.","format":"path","example":"/home/user/public_html/example"},"last_update":{"description":"Information about the most-recent (HEAD) commit for the current branch.\n\n**Note:**\n\n* The system may require a large amount of time to clone large\nrepositories. Until this process finishes, HEAD information is unavailable.\n* `null` is the only possible value.","enum":[null]},"tasks":{"type":"array","items":{"properties":{"args":{"description":"A list of arguments for the\n[Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor)\nsystem's process.","type":"object","properties":{"log_file":{"type":"string","example":"/home/username/.cpanel/logs/vc_1234567890.123456_git_deploy.log","description":"The absolute path to the process's log file.\n\n**Note:**\n\nThe function **only** returns this value if the process\ngenerated a log file."},"repository_root":{"example":"/home/user/example","format":"path","description":"The absolute path to the repository's directory within the user's `home` directory.","type":"string"}}},"subsystem":{"type":"string","description":"The [Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor)\nsubsystem that will handle the task.\n\n* `VersionControl`\n\n**Note:**\n\n`VersionControl` is the only possible value.","enum":["VersionControl"],"example":"VersionControl"},"action":{"example":"create","enum":["create"],"description":"The task's action.\n\n* `create`\n\n**Note:**\n\n`create` is the only possible value.","type":"string"},"sse_url":{"type":"string","description":"The SSE interface to track the progress of the process.","example":"/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0"},"id":{"description":"The [Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor)\nsystem's task ID number.","example":"00000000/5a9ec8dd4c345d","type":"string"}},"type":"object"},"description":"An array of objects containing information about the\n[Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor)\nsystem's process that will clone the repository.\n\n**Note:**\n\nThe function **only** returns this value if it will clone a\nrepository."},"clone_urls":{"properties":{"read_write":{"type":"array","items":{"example":"ssh://user@example.com/home/user/example","type":"string"},"description":"A list of of clone URLs with read-write permissions. The function\nreturns a blank array if the account does **not** include the\n*Shell Access* setting.\n\n**Important:**\n\nIf the server uses a [nonstandard SSH port](https://go.cpanel.net/firewall),\nthe system returns a clone URL that includes the port number."},"read_only":{"type":"array","items":{"format":"url","example":"https://user@example.com/home/user/example","type":"string"},"description":"A list of clone URLs with read-only permissions. The function\nreturns a blank array if the account does **not** include the\n*Shell Access* setting.\n\n**Important:**\n\nIf the server uses a [nonstandard SSH port](https://go.cpanel.net/firewall),\nthe system returns a clone URL that includes the port number."}},"type":"object","description":"An object containing URLs to use to clone the repository."},"type":{"type":"string","example":"git","description":"The repository type.\n\n* `git` — A Git repostiory.\n\n**Note:**\n\n`git` is the only possible value."},"source_repository":{"type":"object","properties":{"remote_name":{"type":"string","description":"The source repository's name.","example":"remote"},"url":{"type":"string","example":"http://user@domain.com/home/user/domain","format":"url","description":"The source repository's clone URL."}},"description":"A object containing information about a cloned repository's source\nrepository.\n\n**Note:**\n\nThe function **only** returns this object if it will clone a\nrepository."}},"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"VersionControl","type":"string"},"func":{"type":"string","example":"create","description":"The name of the method called."}}}}}}},"operationId":"VersionControl::create","description":"This function creates a new Git™ repository on a cPanel account.\n\n* For more information about support for version control in cPanel & WHM, read our\n[Git Version Control](https://go.cpanel.net/GitVersionControl) and\n[Guide to Git](https://go.cpanel.net/GitDeployment) documentation.\n* For a list of configuration changes, repository restrictions, and troubleshooting steps,\nread our [Guide to Git - For System Administrators](https://go.cpanel.net/GuidetoGitForSystemAdministrators) documentation.\n\n**Important:**\n\nThe system logs errors for this function in the `~/.cpanel/logs/vc_TIMESTAMP_git_create.log`\nfile, where `TIMESTAMP` represents the time of the error in Unix epoch time.","parameters":[{"schema":{"example":"git","enum":["git"],"type":"string"},"description":"The repository type.\n\n* `git` — A [Git](https://git-scm.com/) repository.\n\n**Note:**\n\n`git` is the only possible value.","required":"true","in":"query","name":"type"},{"schema":{"type":"string","example":"example"},"description":"The new repository's display name.","required":"true","name":"name","in":"query"},{"schema":{"format":"path","example":"/home/user/public_html/example","type":"string"},"description":"The absolute path to the directory in which to store the repository, relative to the\nuser's `home` directory.\n\n**Note:**\n\n* If the directory does **not** exist, the system will create it.\n* If the specified directory already contains a repository, the system will\nautomatically add it to the list of cPanel-managed repositories.\n* This feature enforces several restrictions on repository paths. For more information,\nread our [Guide to Git - For System Administrators](https://go.cpanel.net/GuidetoGitForSystemAdministrators) documentation.","required":"true","name":"repository_root","in":"query"},{"content":{"application/json":{"schema":{"properties":{"url":{"description":"The source repository's clone URL.","type":"string"},"remote_name":{"description":"The source repository's name.","default":"origin","type":"string"}},"required":["url"],"example":{"url":"ssh://clone.domain.com/cloneme","remote_name":"origin"}}}},"description":"A JSON-formatted object containing information about the source repository that the\nsystem will clone.\n\n**Note:**\n\nIf you do **not** include source repository data, the function creates an empty repository.","required":"false","name":"source_repository","in":"query"}],"x-cpanel-api-version":"UAPI","summary":"Create Git repository","tags":["VersionControl","Repository Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  VersionControl \\\n  create \\\n  type='git' \\\n  name='example' \\\n  repository_root='/home/user/public_html/example'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/VersionControl/create?type=git&name=example&repository_root=%2fhome%2fuser%2fpublic_html%2fexample","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file VersionControl_create.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/VersionControl_create.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/VersionControl/,\n    q/create/,\n    {\n        'type' => 'git',\n        'name' => 'example',\n        'repository_root' => '/home/user/public_html/example',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file VersionControl_create.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/VersionControl_create.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    'VersionControl',\n    'create',\n    array (\n        'type' => 'git',\n        'name' => 'example',\n        'repository_root' => '/home/user/public_html/example',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"tags":[{"name":"VersionControl","description":"The VersionControl module for UAPI."},{"name":"Repository Management","description":"GIT Management / Repository Management"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"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/","version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"update":{"tags":[{"name":"VersionControl","description":"The VersionControl module for UAPI."},{"description":"GIT Management / Repository Management","name":"Repository Management"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Repository Management"],"name":"GIT Management"}],"paths":{"/VersionControl/update":{"get":{"tags":["VersionControl","Repository Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  VersionControl \\\n  update \\\n  repository_root='/home/user/public_html/example'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/VersionControl/update?repository_root=%2fhome%2fuser%2fpublic_html%2fexample","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file VersionControl_update.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/VersionControl_update.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/VersionControl/,\n    q/update/,\n    {\n        'repository_root' => '/home/user/public_html/example',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file VersionControl_update.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/VersionControl_update.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    'VersionControl',\n    'update',\n    array (\n        'repository_root' => '/home/user/public_html/example',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Update Git repository settings","description":"This function modifies a Git™ repository's basic settings. For more information about support\nfor version control in cPanel & WHM, read our\n[Git Version Control](https://go.cpanel.net/GitVersionControl)\nand [Guide to Git](https://go.cpanel.net/GitDeployment) documentation.\n\n**Note:**\n\n* This function **only** pulls changes from the remote repository if you specify a `branch` value.\n* You **cannot** modify the `type`, `repository_root`, or `url` values for existing repositories.\n* You **must** include the `repository_root` parameter in order to identify the repository to\nupdate.\n* All other input parameters are **optional**. Use them to assign the **new** values to the\naccount. If you do not include a parameter or specify its existing value, no change will occur.","operationId":"VersionControl::update","parameters":[{"in":"query","name":"repository_root","required":"true","description":"The absolute directory path that contains the repository to update.","schema":{"format":"path","example":"/home/user/public_html/example","type":"string"}},{"description":"The repository's new display name.\n\nIf you do not specify a value, the function does **not** update this parameter.","schema":{"type":"string","example":"example"},"name":"name","in":"query","required":"false"},{"required":"false","name":"branch","in":"query","schema":{"type":"string","example":"master"},"description":"The new branch to use.\n\nIf you do not specify a value, the function does **not** update this parameter.\n\n**Remember:**\n\nThis function **only** pulls changes from the remote repository if you specify\nthis value."},{"description":"A JSON-encoded object containing information about the source repository.\n\nIf you do not specify a value, the function does **not** update this parameter.\n\n**Important:**\n\n* You **cannot** modify the source repository's URL.\n* You **must** JSON-encode the contents of this object.","content":{"application/json":{"schema":{"properties":{"remote_name":{"type":"string","description":"The source repository's name. If you do not specify a value, the function does **not** update this parameter."}},"type":"object","example":{"remote_name":"origin"}}}},"in":"query","name":"source_repository","required":"false"}],"x-cpanel-available-version":"cPanel 72","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"data":{"type":"object","properties":{"branch":{"description":"The repository's current branch.\n\n* `null` — The system has not finished the clone process for the\nrepository, no local branches exist, or the repository is a bare\nrepository.","nullable":"true","type":"string"},"available_branches":{"items":{"type":"string","nullable":"true"},"description":"A list of local and remote branches available for the cloned or\nexisting repository.\n\n* An empty array, if no branches exist.\n* `null` — The repository is a bare repository.","type":"array"},"name":{"type":"string","description":"The repository's display name."},"repository_root":{"description":"The directory path that exists in the user's `home` directory containing the repository.","type":"string"},"last_update":{"nullable":"true","description":"An object containing information about the most recent (HEAD) commit for\nthe current branch.\n\n**Note:**\n\nThis object's information resembles the output of the `git log -1`\ncommand.\n\n**Important:**\n\n* If the repository does **not** include any commits, the function\nreturns a `null` value instead of an object.\n* The system may require a large amount of time to clone larger repositories.\nUntil this process finishes, HEAD information is unavailable.","type":"object","properties":{"author":{"description":"The most recent commit's author name and email address.","type":"string"},"date":{"description":"The timestamp for the most recent commit.","format":"unix_timestamp","type":"integer"},"identifier":{"description":"The identifier (SHA-1 value) for the most recent commit.","type":"string"},"message":{"type":"string","description":"The commit message."}}},"deployable":{"enum":["1","0"],"description":"Whether the system could deploy the repository.\n\n* `1` — Can deploy.\n* `0` — Cannot deploy.","type":"integer"},"clone_urls":{"description":"An object containing the URLs to use to clone the repository.\n\nThe function returns an empty object if the account does **not**\ninclude the *Shell Access* setting.\n\n**Important:**\n\nIf the server uses a nonstandard SSH port, the system returns a\nclone URL that includes the port number. ","properties":{"read_only":{"items":{"format":"url","type":"string"},"description":"A list of clone URLs with read-only permissions.\n\nThis function returns an empty list if the account does\n**not** include the *Shell Access* setting.\n\n**Important:**\n\nIf the server uses a nonstandard SSH port, the system returns a\nclone URL that includes the port number.","type":"array"},"read_write":{"type":"array","items":{"type":"string"},"description":"A list of clone URLs with read-write permissions.\n\nThis function returns an empty list if the account does\n**not** include the *Shell Access* setting.\n\n**Important:**\n\nIf the server uses a nonstandard SSH port, the system returns a\nclone URL that includes the port number."}},"type":"object"},"tasks":{"items":{"type":"object","properties":{"id":{"type":"string","description":"The Task Queue system's task ID number."},"args":{"type":"object","properties":{"log_file":{"description":"The absolute path to the process log file in the user's\n`home` directory.\n\n**Note:**\n\nThe function **only** returns this value if the process\ngenerated a log file.","type":"string"},"repository_root":{"type":"string","description":"The repository's absolute directory path in the user's `home` directory."}},"description":"An object containing arguments for the Task Queue system's process."},"subsystem":{"enum":["VersionControl"],"description":"The Task Queue subsystem that will handle the task.\n\n* `VersionControl`\n\n**Note:**\n\n* `VersionControl` is the only possible value.","type":"string"},"action":{"description":"The task's action.\n\n* `create` — Create the repository.\n* `deploy` — Deploy the repository.","enum":["create","deploy"],"type":"string"}}},"description":"An array of objects containing information about the\n[Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor)\nsystem's process that will clone the repository.\n\n**Note:**\n\nThe function **only** returns this value if the clone process is\nnot finished.","type":"array"},"last_deployment":{"properties":{"deployment_date":{"type":"integer","format":"unix_timestamp","description":"The timestamp for the most recent deployment."},"repository_state":{"description":"A object containing information about the state of the repository at the time of the most recent deployment.","properties":{"identifier":{"description":"The identifier (SHA-1 value) for the commit that the system most recently deployed.","type":"string"},"message":{"description":"The commit message for the commit that the system most recently deployed.","type":"string"},"author":{"type":"string","description":"The author's name and email address for the commit that the system most recently deployed."},"date":{"type":"integer","description":"The timestamp for the commit that the system most recently deployed.","format":"unix_timestamp"}},"type":"object"}},"type":"object","description":"An object containing information about the commit that the system\nmost recently deployed.\n\n**Note:**\n\nIf no deployment information exists, the function returns a `null` value.","nullable":"true"},"source_repository":{"description":"An object containing information about the source repository.\n\n**Note:**\n\nThe function **only** returns this object if you cloned a source\nrepository.","properties":{"remote_name":{"type":"string","description":"The source repository's name."},"url":{"type":"string","description":"The source repository's clone URL."}},"type":"object"},"type":{"description":"The repository type.\n\n* `git` — A [Git](https://git-scm.com/) repository.\n\n**Note:**\n\n* `git` is the only possible value.","enum":["git"],"type":"string"}},"example":{"branch":"master","available_branches":["master"],"name":"example","repository_root":"/home/user/example","last_update":{"message":"I'm committing some particularly cromulent code.","identifier":"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12","date":"1569844800","author":"Jane Doe <jane.doe@example.com>"},"deployable":"1","tasks":[{"id":"00000000/5a9ec8dd4c345d","subsystem":"VersionControl","action":"create","args":{"repository_root":"/home/user/example"}}],"last_deployment":{"deployment_date":"1569844800","repository_state":{"message":"I'm committing some particularly cromulent code.","identifier":"2fd4e1c67a2d28fced849ee1bb76e7391b93eb121","author":"User Name <user.name@example.com>","date":"1569844800"}},"clone_urls":{"read_only":["https://user@example.com/home/user/example"],"read_write":["ssh://user@example.com/home/user/example"]},"type":"git"}},"status":{"example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"VersionControl"},"func":{"description":"The name of the method called.","example":"update","type":"string"}}}}}}}}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"retrieve":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"name":"VersionControl","description":"The VersionControl module for UAPI."},{"name":"Repository Management","description":"GIT Management / Repository Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Repository Management"],"name":"GIT Management"}],"paths":{"/VersionControl/retrieve":{"get":{"parameters":[{"required":"false","name":"fields","in":"query","schema":{"example":"name,type,branch,last_update","default":"*","type":"string"},"description":"A comma-separated list of desired return values.\n\n**Note:**\n\nUse a wildcard (`*`) to list all possible return values."}],"description":"This function lists Git™ repositories on a cPanel account. For more information\nabout support for version control in cPanel & WHM, read our\n[Git Version Control](https://go.cpanel.net/GitVersionControl) and\n[Guide to Git](https://go.cpanel.net/GitDeployment) documentation.\n\n**Important:**\n\n* This feature does **not** allow the following characters in repository paths:\n  ``\\ * | \" ' < > & @ ` $ { } [ ] ( ) ; ? : = % #``\n* This function does **not** allow repositories that exist in the following\ncPanel-controlled directories:\n\n  * `.cpanel`\n  * `.htpasswds`\n  * `.ssh`\n  * `.trash`\n  * `access-logs`\n  * `cgi-bin`\n  * `etc`\n  * `logs`\n  * `perl5`\n  * `mail`\n  * `spamassassin`\n  * `ssl`\n  * `tmp`\n  * `var`\n\nUsers can create repositories in some of these directories on the command line.\nThey may appear in the list of repositories in Gitweb, but users may see an error\nmessage if they try to access them.","operationId":"VersionControl::retrieve","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"VersionControl","type":"string"},"result":{"properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"data":{"items":{"properties":{"last_update":{"nullable":"true","description":"An object containing information about the most-recent (HEAD) commit\nfor the current branch. \n\n**Note:**\n\nThis object's information resembles the output of the `git log -1`\ncommand.\n\n**Important:**\n\n* If the repository does not include any commits, the function returns\na `null` value instead of an object.\n* The system may require a large amount of time to clone larger\nrepositories. Until this process finishes, HEAD information is\nunavailable.","type":"object","properties":{"identifier":{"description":"The identifier (SHA-1 value) for the most-recent commit.","example":"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12","type":"string"},"message":{"description":"The commit message.","example":"I'm committing some particularly cromulent code.","type":"string"},"date":{"type":"integer","format":"unix_timestamp","description":"The timestamp for the most-recent commit.","example":"1569844800"},"author":{"type":"string","description":"The most-recent commit's author's name and email address.","example":"Jane Doe <jane.doe@example.com>"}}},"deployable":{"description":"Whether the system could deploy the repository.\n\n* `1` — Can deploy.\n* `0` — Cannot deploy.","enum":["1","0"],"type":"integer"},"last_deployment":{"description":"An object containing information about the commit that the system\nmost recently deployed.\n\n**Note:**\n\nThe system **only** returns this object if deployment information\nexists.","properties":{"repository_state":{"properties":{"message":{"description":"The commit message for the commit that the system most recently deployed.","type":"string"},"identifier":{"description":"The identifier (SHA-1 value) for the commit that the system most recently deployed.","type":"string"},"author":{"description":"The author's name and email address for the commit that the system most recently deployed.","type":"string"},"date":{"format":"unix_timestamp","description":"The timestamp for the commit that the system most recently deployed.","type":"integer"}},"type":"object","description":"A object containing information about the state of the repository at the time of the most recent deployment."},"deployment_date":{"type":"integer","description":"The timestamp for the most-recent deployment.","format":"unix_timestamp"}},"type":"object"},"tasks":{"type":"array","description":"An array of objects containing information about the\n[Task Queue](https://go.cpanel.net/whmdocsTaskQueueMonitor)\nsystem's process that will clone the repository.\n\n**Note:**\n\nThe function only returns this value if the clone process is\n**not** finished.","items":{"properties":{"subsystem":{"type":"string","description":"The Task Queue subsystem that will handle the task.\n\n* `VersionControl` is the only possible value.","example":"VersionControl","enum":["VersionControl"]},"action":{"description":"The task's action.\n\n* `create` — Create the repository.\n* `deploy` — Deploy the repository.","enum":["create","deploy"],"type":"string"},"sse_url":{"type":"string","example":"/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0","description":"The Secure Server Events (SSE) interface URL to track the progress of the process."},"args":{"description":"A list of arguments for the Task Queue system's process.","type":"object","properties":{"repository_root":{"type":"string","description":"The absolute path to the repository's directory in the user's `home` directory.","example":"/home/user/example"},"log_file":{"description":"The absolute path to the process's log file.\n\n**Note:**\n\nThe function only returns this value if the process generated\na log file.","format":"path","example":"/home/username/.cpanel/logs/vc_1234567890.123456_git_deploy.log","type":"string"}}},"id":{"type":"string","example":"00000000/5a9ec8dd4c345d","description":"The Task Queue system's task ID number."}},"type":"object"}},"clone_urls":{"description":"An array of objects containing URLS to use to clone the repository.","properties":{"read_only":{"description":"A list of clone URLs with read-only permissions.\n\nThis function returns a blank array if the account does\nnot include the *Shell Access* setting.\n\n**Important:**\n\nIf the server uses a nonstandard SSH port, the system returns a\nclone URL that includes the port number.","items":{"type":"string"},"type":"array"},"read_write":{"type":"array","description":"A list of clone URLs with read-write permissions.\n\nThis function returns a blank array if the account does\nnot include the *Shell Access* setting.\n\n**Important:**\n\nIf the server uses a nonstandard SSH port, the system returns a\nclone URL that includes the port number.","items":{"type":"string"}}},"type":"object"},"type":{"type":"string","example":"git","enum":["git"],"description":"The repository type.\n\n* `git` is the only possible value."},"source_repository":{"type":"object","properties":{"remote_name":{"type":"string","description":"The source repository's name.","example":"origin"},"url":{"type":"string","example":"ssh://clone.domain.com/cloneme","description":"The source repository's clone URL."}},"description":"An object containing information about the source repository.\n\n**Note:**\n\nThe function **only** returns this object if you cloned a source\nrepository."},"available_branches":{"type":"array","items":{"type":"string"},"description":"A list of available local and remote branches for the cloned\nor existing repository.\n\n* An empty array — No branches exist.\n* `null` — The repository is a bare repository.","nullable":"true"},"branch":{"type":"string","nullable":"true","description":"The repository's current branch.\n\n* `null` — The system has not finished the clone process for the\nrepository, no local branches exist, or the repository is a bare\nrepository."},"name":{"example":"example","description":"The repository's display name.","type":"string"},"repository_root":{"type":"string","description":"The absolute directory path in the user's `home` directory containing the repository.","format":"path","example":"/home/user/public_html/example"}},"type":"object"},"description":"An array of objects containing repository data.","example":[{"available_branches":["master"],"branch":"master","repository_root":"/home/user/example","name":"example","deployable":"1","last_update":{"identifier":"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12","message":"I'm committing some particularly cromulent code.","author":"Jane Doe <jane.doe@example.com>","date":"1598774400"},"type":"git","tasks":[{"action":"create","subsystem":"VersionControl","sse_url":"/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0","args":{"log_file":"/home/user/.cpanel/logs/vc_1526305129.123456_git_create.log","repository_root":"/home/user/example"},"id":"00000000/5a9ec8dd4c345d"}],"last_deployment":{"deployment_date":"1598774400","repository_state":{"message":"I'm committing some particularly cromulent code.","identifier":"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12","date":"1598774400","author":"User Name <user.name@example.com>"}},"clone_urls":{"read_write":["ssh://user@example.com/home/user/example"],"read_only":["https://user@example.com/home/user/example"]}},{"name":"example2","type":"git","repository_root":"/home/user/example2","last_update":{"identifier":"4ee0b73ddf78213c41fcc185acfab68ced99046d","tasks":[{"id":"00000000/5a9ec8dd4c345d","sse_url":"/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0","action":"create","subsystem":"VersionControl","args":{"log_file":"/home/user/.cpanel/logs/vc_1526305129.123456_git_create.log","repository_root":"/home/user/example"}}],"last_deployment":{"deployment_date":"1599730200","repository_state":{"message":"I'm committing some particularly cromulent code.","identifier":"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12","author":"User Name <user.name@example.com>","date":"1599730200"}},"clone_urls":{"read_write":["ssh://user@example.com/home/user/example"],"read_only":["https://user@example.com/home/user/example"]},"author":"June Due <june.due@example2.com>","message":"My code makes more sense, actually.","date":"1599730200"},"branch":"master","deployable":"1","available_branches":["master"]}],"type":"array"},"status":{"type":"integer","example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"description":"The name of the method called.","example":"retrieve","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 72","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  VersionControl \\\n  retrieve\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/VersionControl/retrieve"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file VersionControl_retrieve.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/VersionControl_retrieve.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/VersionControl/,\n    q/retrieve/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file VersionControl_retrieve.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/VersionControl_retrieve.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    'VersionControl',\n    'retrieve'\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}"}],"tags":["VersionControl","Repository Management"],"summary":"Return Git repositories","x-cpanel-api-version":"UAPI"}}}}},"ResourceUsage":{"get_usages":{"tags":[{"description":"The ResourceUsage module for UAPI.","name":"ResourceUsage"},{"name":"Resource Usage and Statistics","description":"cPanel Account / Resource Usage and Statistics"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"name":"cPanel Account","tags":["Resource Usage and Statistics"]}],"paths":{"/ResourceUsage/get_usages":{"get":{"description":"This function retrieves resource usage and custom statistics for a cPanel user account.","operationId":"get_usages","parameters":[],"x-cpanel-available-version":"cPanel 70","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_usages"},"module":{"example":"ResourceUsage","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"data":{"type":"array","description":"An array of objects containing resource usage information from the account's query.","items":{"properties":{"usage":{"type":"integer","minimum":"0","description":"The resource's current usage value.","example":"0"},"maximum":{"type":"integer","minimum":"0","nullable":"true","description":"The resources's maximum usage value.\n\n**Note:**\n\n This function returns an null value for an (unlimited) quota.","example":"15"},"formatter":{"example":"format_bytes","description":"The resource's defined output format.\n\n* `format_bytes`\n* `format_bytes_per_second`\n* `percent`\n* `null` — No defined output format.\n\n**Note:**\n\nThird-party modules will return their defined formatter value.","oneOf":[{"type":"string","description":"The resource's defined output format.","enum":["format_bytes","format_bytes_per_second","percent"],"nullable":"true"},{"type":"string","description":"A third-party module's defined formatter value."}]},"id":{"example":"mysql_databases","description":"The resource's reference name.\n* `disk_usage`\n* `filesusage` - This function **only** returns this value if the *Display File Usage information in the cPanel stats bar* setting is enabled in the *Display* section of WHM's [*Tweak Settings*](https://go.cpanel.net/whmdocsTweakSettings#display) interface (*WHM >> Home >> Server Configuration >> Tweak Settings*).\n* `cachedmysqldiskusage`\n* `cachedpostgresdiskusage` - This function **only** returns this value if [PostgreSQL® databases](https://go.cpanel.net/cpaneldocsPostgreSQLDatabases) are enabled.\n* `bandwidth`\n* `addon_domains`\n* `subdomains`\n* `aliases`\n* `email_accounts`\n* `mailing_lists` - This function **only** returns this value if the Mailman service is enabled in WHM's [*Service Manager*](https://go.cpanel.net/whmdocsServiceManager) interface (*WHM >> Home >> Service Configuration >> Service Manager*).\n* `autoresponders`\n* `forwarders`\n* `email_filters`\n* `ftp_accounts` - This function **only** returns this value if FTP accounts exist on the server.\n* `mysql_databases` - This function **only** returns this value if MySQL® databases are enabled.\n* `postgresql_databases`\n\n**Note:**\n\nCertain `id` values may **not** appear, based on the [server's current profile](https://go.cpanel.net/howtouseserverprofiles#profiles).","type":"string"},"error":{"example":null,"description":"An error message, if applicable.","nullable":"true","type":"string"},"url":{"example":"sql/index.html","description":"The resource's defined URL link to its corresponding interface, in applicable.","format":"url-path","type":"string"},"description":{"example":"MySQL® Databases","description":"The resource's UI display name.","type":"string"}},"type":"object"}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"- `1` - Success.\n- `0` - Failed. Check the errors field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{}},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null,"nullable":"true","type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}}}},"tags":["ResourceUsage","Resource Usage and Statistics"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ResourceUsage \\\n  get_usages\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ResourceUsage/get_usages","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ResourceUsage_get_usages.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/ResourceUsage_get_usages.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/ResourceUsage/,\n    q/get_usages/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ResourceUsage_get_usages.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/ResourceUsage_get_usages.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    'ResourceUsage',\n    'get_usages'\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","summary":"Return resource usage and custom statistics"}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"}}},"UserManager":{"edit_user":{"tags":[{"description":"The UserManager module for UAPI.","name":"UserManager"},{"name":"Subaccount Management","description":"cPanel Account / Subaccount Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Subaccount Management"],"name":"cPanel Account"}],"paths":{"/UserManager/edit_user":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"UserManager"},"result":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/EditUserSubaccountBase"},{"$ref":"#/components/schemas/SubaccountMergeCandidates"}],"type":"object","properties":{"dismissed_merge_candidates":{"type":"array","description":"An array of objects of service candidates that the system dismissed from merges.","items":{"$ref":"#/components/schemas/SubaccountMergeCandidates"}}}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"edit_user"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 54","parameters":[{"schema":{"type":"string","nullable":"true","example":"user@example.com","format":"email","default":null},"description":"An alternate email address for the Subaccount's user.\n\n**Note:**\n\n The cPanel account user could use this email address to contact the Subaccount user if their primary email address's domain is unavailable.","required":"false","in":"query","name":"alternate_email"},{"schema":{"type":"string","default":null,"format":"url","example":"https://img.example.com/avatars/example.jpg","nullable":"true"},"description":"**Warning:**\n\n We reserved this parameter for future use. Do **not** use this parameter.\n\nThe user's Subaccount profile photo.\n\n**Note:**\n\n You **must** use the HTTPS protocol to prevent mixed content warnings when users view the photo from another HTTPS URL.","required":"false","name":"avatar_url","in":"query"},{"description":"The Subaccount user's associated domain.\n\nA domain that the cPanel account owns.","schema":{"example":"example.com","format":"domain","type":"string"},"in":"query","name":"domain","required":"true"},{"in":"query","name":"password","required":"false","description":"The Subaccount's new password.\n\n**Note:**\n\n The Subaccount uses this password for email, FTP, and Web Disk services.","schema":{"example":"12345luggage","type":"string"}},{"schema":{"example":"+15551234567","default":null,"nullable":"true","type":"string"},"description":"The Subaccount user's phone number.\n\n**Warning:**\n\n We reserved this parameter for future use. Do **not** use this parameter.\n\nThe number conforms to the [ITU-T](https://en.wikipedia.org/wiki/ITU-T)'s [E.164](https://en.wikipedia.org/wiki/E.164)-recommended standard for the representation of telephone numbers.","required":"false","name":"phone_number","in":"query"},{"in":"query","name":"real_name","required":"false","description":"The Subaccount user's name.\n\n* A first name.\n* A last name.\n* A first name and last name.\n* An empty string.","schema":{"type":"string","default":null,"example":"John Doe","nullable":"true"}},{"description":"Whether to grant the Subaccount email access.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","schema":{"enum":["0","1"],"example":"1","default":"0","type":"integer"},"in":"query","name":"services.email.enabled","required":"false"},{"in":"query","name":"services.email.quota","required":"false","description":"The maximum amount of disk space, in megabytes (MB), that the subaccount's email account may use.\n\nIf you do not declare a value, the system defaults to the defined system value.\n\n**Note:**\n\n This value **cannot** be greater than the maximum email quota.\n\n* `0` or `unlimited` - The subaccount possesses unlimited disk space.","schema":{"type":"integer","example":"500"}},{"required":"false","name":"services.ftp.enabled","in":"query","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"description":"Whether to grant the Subaccount FTP access.\n\n* `1` - Can access.\n* `0` - **Cannot** access."},{"description":"The Subaccount's FTP home directory.\n\n**Note:**\n\n This parameter is **required** if you enable FTP access.\n\nA relative path from the cPanel account's home directory.\n\n**Note:**\n\n The specified directory **must** exist.","schema":{"type":"string","format":"path","example":"/Subaccount"},"name":"services.ftp.homedir","in":"query","required":"false"},{"in":"query","name":"services.webdisk.enabled","required":"false","description":"Whether to grant the Subaccount Web Disk access.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","schema":{"type":"integer","example":"1","enum":["0","1"],"default":"0"}},{"in":"query","name":"services.webdisk.enabledigest","required":"false","description":"Whether to enable Web Disk digest authentication.\n\n**Notes:**\n\n * **Only** enable Digest Authentication for clients that require additional compatibility support on certain versions of Windows® operating systems. This compatibility support is **only** required on servers that use a self-signed certificate for the `cpsrvd` and `cpdavd` daemons.\n * We recommend that you do **not** use Digest Authentication.\n\n\n* `1` - Enabled\n* `0` - Disabled.","schema":{"enum":["0","1"],"example":"0","default":"0","type":"integer"}},{"name":"services.webdisk.private","in":"query","required":"false","description":"Whether to set the Web Disk directory's permissions to public or private.\n\n* `1` - Private (`0700`).\n* `0` - Public (`0755`).","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"}},{"schema":{"example":"/Subaccount","format":"path","type":"string"},"description":"The Subaccount's Web Disk home directory.\n\n**Note:**\n\n This parameter is **required** if you enable Web Disk access.\n\nA relative path from the cPanel account's home directory.","required":"false","in":"query","name":"services.webdisk.homedir"},{"required":"false","in":"query","name":"services.webdisk.perms","schema":{"enum":["ro","rw"],"example":"rw","default":"rw","type":"string"},"description":"Whether to grant write permissions to the Subaccount.\n\n**Note:**\n\n The `services.webdisk.homedir` parameter determines the Subaccount's Web Disk home directory.\n\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions."},{"schema":{"default":"sub","enum":["sub"],"example":"sub","type":"string"},"description":"The type of account.\n\n* `sub` - A Subaccount.","required":"false","in":"query","name":"type"},{"name":"username","in":"query","required":"true","description":"The Subaccount's username.\n\n* Length - 64 characters.\n* Characters - `a-z`, `A-Z`, `0-9`, dot (`.`), hyphen (`-`), underscore (`_`).\n\n**Note:**\n\n This value does **not** include the domain name.","schema":{"type":"string","example":"example"}}],"description":"This function edits a Subaccount.","operationId":"edit_user","x-cpanel-api-version":"UAPI","summary":"Update Subaccount settings","tags":["UserManager","Subaccount Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  edit_user \\\n  domain='example.com' \\\n  password='12345luggage' \\\n  username='example'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/edit_user?domain=example.com&password=12345luggage&username=example","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_edit_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_edit_user.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/UserManager/,\n    q/edit_user/,\n    {\n        'domain' => 'example.com',\n        'password' => '12345luggage',\n        'username' => 'example',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_edit_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_edit_user.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    'UserManager',\n    'edit_user',\n    array (\n        'domain' => 'example.com',\n        'password' => '12345luggage',\n        'username' => 'example',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{"SubaccountMergeCandidatesEmpty":{"type":"object","properties":{"merge_candidates":{"description":"An array of objects that represents the service accounts that the system could merge for this subaccount.","items":{"type":"object"},"type":"array"}}},"EditUserSubaccountBase":{"properties":{"alternate_email":{"type":"string","example":"user@example.com","description":"An alternate email address for the subaccount's user.","format":"email"},"dismissed":{"type":"integer","description":"Whether the cPanel account user dismissed the merge prompt for the service account.\n\n**Note:**\n\n  **Only** service accounts return this value.\n\n* `1` - Dismissed.\n* `0` - Did **not** dismiss.","enum":["0","1"],"example":"1"},"can_delete":{"type":"integer","description":"Whether the cPanel account user can delete the subaccount.\n\n* `1` - Can delete.\n* `0` - **Cannot** delete.","enum":["0","1"],"example":"0"},"synced_password":{"description":"Whether the user has synchronized the passwords for each of the subaccount's service accounts.\n\n* `1` - Synchronized.\n* `0` - **Not** synchronized.\n\n**Note:**\n\n  The function returns a `null` value if the account is **not** a subaccount.","example":"0","enum":["0","1"],"type":"integer"},"special":{"description":"Whether the account is a system-created special account that the user **cannot** remove.\n\n* `1` - A special account.\n* `0` - **Not** a special account.","enum":["0","1"],"example":"1","type":"integer"},"username":{"type":"string","description":"The username for the subaccount.\n\n* Length - 64 characters.\n* Characters - `a-z`, `A-Z`, `0-9`, dot (`.`), hyphen (`-`), underscore (`_`).\n\n**Note:**\n\n  This value does **not** include the domain name.","example":"example"},"can_set_quota":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether the cPanel account user can change the subaccount's disk usage quota.\n\n* `1` - Can change.\n* `0` - **Cannot** change."},"guid":{"description":"The subaccount unique identifier.","example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4","type":"string"},"parent_type":{"example":"hypothetical","description":"The type of account that could own the service account.\n\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** yet exist, but the user could create as part of a merge.\n* `null`- **Not** a merge candidate.","type":"string"},"full_username":{"description":"The subaccount's username and domain name.","example":"user@example.com","type":"string"},"sub_account_exists":{"description":"Whether a subaccount exists with the same username.\n\n* `1` - Exists.\n* `0` - Does **not** exist.\n\n**Note:**\n\n  The function returns a `null` value if the account is **not** a service account.","example":"0","enum":["0","1"],"type":"integer"},"has_invite":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether an account login invitation exists.\n\n* `1` - Account invitation exists.\n* `0` - Account invitation does **not** exist."},"has_expired_invite":{"type":"integer","description":"Whether an expired account login invitation exists.\n\n* `1` - Expired account invitation exists.\n* `0` - Expired account invitation does **not** exist.","enum":["0","1"],"example":"0"},"invite_expiration":{"example":"1591718154","format":"unix_timestamp","description":"When the invitation expires.","type":"integer"},"type":{"description":"The type of account.\n\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** exist, but that the user could create as part of a merge.\n* `service` - A service account.\n* `cpanel` - The cPanel account.","example":"sub","type":"string"},"can_set_password":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the cPanel account user can change the subaccount's password.\n\n* `1` - Can change.\n* `0` - **Cannot** change.\n\n**Note:**\n\n  The function returns a `0` value for subaccounts that inherit their password from the cPanel account."},"phone_number":{"description":"The subaccount user's phone number.\n\nThe number conforms to the [ITU-T](https://en.wikipedia.org/wiki/ITU-T)'s [E.164](https://en.wikipedia.org/wiki/E.164)-recommended standard for the representation of telephone numbers.","example":"+15551234567","type":"string"},"issues":{"type":"array","items":{"properties":{"type":{"description":"The type of issue.\n* `error`\n* `warning`\n* `info`","enum":["error","warning","info"],"example":"info","type":"string"},"limit":{"description":"The set quota megabyte (MB) limit for the affected subaccount.","example":"1500","type":"integer"},"area":{"type":"string","example":"quota","description":"The affected section of cPanel & WHM."},"message":{"type":"string","example":"Your account is over quota.","description":"The description of the issue."},"service":{"type":"string","enum":["email","ftp","webdisk"],"example":"email","description":"The affected service.\n* `email`\n* `ftp`\n* `webdisk`"},"used":{"type":"integer","description":"The number of megabytes (MB) that the account currently uses.","example":"2000"}},"type":"object"},"description":"Information about any issues or problems with the subaccount."},"services":{"properties":{"ftp":{"description":"This object contains the information that indicates the subaccount's FTP status.","properties":{"homedir":{"example":"/subaccount","format":"path","description":"The subaccount's FTP home directory.","type":"string"},"enabled":{"type":"integer","description":"Whether the subaccount can access FTP.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"0"},"quota":{"type":"integer","example":"100","description":"The maximum amount disk space, in megabytes (MB), that the subaccount may use.\n\n* A positive integer between `1` and `999999`\n* `0` - Unlimited."}},"type":"object"},"webdisk":{"properties":{"private":{"type":"integer","description":"Whether to set the Web Disk directory's permissions to public or private.\n\n* `1` - Private (`0700`).\n* `0` - Public (`0755`).","enum":["0","1"],"example":"0"},"enabled":{"description":"Whether the subaccount can access Web Disk.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"0","type":"integer"},"homedir":{"example":"/bob","description":"The subaccount's Web Disk home directory.","format":"path","type":"string"},"perms":{"description":"Whether to grant write permissions to the subaccount.\n\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.","enum":["ro","rw"],"example":"rw","type":"string"}},"type":"object","description":"This object contains information that indicates the subaccount's Web Disk status."},"email":{"properties":{"quota":{"description":"The maximum amount of disk space, in megabytes (MB), allocated to the subaccount's email account.\n\n**Note:**\n\n  This function will not return `0` as a value.","example":"100","type":"integer"},"enabled":{"description":"Whether the subaccount can access Webmail, POP, and IMAP services.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","example":"1","enum":["0","1"],"type":"integer"}},"type":"object","description":"This object contains the information that indicates the subaccount's email status."}},"type":"object","description":"This object contains information about the subaccount's access to email, FTP, and Web Disk."},"domain":{"example":"example.com","format":"domain","description":"The Subaccount user's associated domain.\n\nA domain that the cPanel account owns.","type":"string"},"has_siblings":{"type":"integer","description":"Whether the service account shares a `full_username` value with another service account.\n\n* `1` - Shares.\n* `0` - Does **not** share.","enum":["0","1"],"example":"0"},"real_name":{"description":"The name of the subaccount's user.\n\n* A first name, a last name, or a first name and last name.\n* An empty string.","example":"John Doe","type":"string"},"avatar_url":{"example":"https://img.example.com/avatars/example.jpg","format":"url","description":"The user's subaccount profile photo.","type":"string"}},"type":"object"},"SubaccountMergeCandidates":{"type":"object","properties":{"merge_candidates":{"items":{"allOf":[{"$ref":"#/components/schemas/EditUserSubaccountBase"},{"$ref":"#/components/schemas/SubaccountMergeCandidatesEmpty"}]},"description":"An array of objects that represents the service accounts that the system could merge for this subaccount.","type":"array"}}}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"}},"change_password":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"description":"The UserManager module for UAPI.","name":"UserManager"},{"description":"cPanel Account / Account Management","name":"Account Management"}],"paths":{"/UserManager/change_password":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"change_password","description":"The name of the method called.","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"UserManager"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"data":{"type":"object","default":null,"nullable":"true"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}}}},"x-cpanel-available-version":"cPanel 116","parameters":[{"schema":{"type":"string","example":"ThisWasMyPassword!","format":"password"},"description":"The current password.","required":"true","name":"oldpass","in":"query"},{"required":"true","in":"query","name":"newpass","schema":{"format":"password","example":"MyNewPassw0rd!","type":"string"},"description":"The new password."},{"required":"false","name":"enablemysql","in":"query","schema":{"type":"integer","example":"0","enum":["0","1"],"default":"0"},"description":"Whether to update the cPanel account's MySQL password.\n* `1` - Update MySQL password.\n* `0` - Do not update MySQL passowrd."}],"description":"This function updates the cPanel account's password.","operationId":"change_password","x-cpanel-api-version":"UAPI","summary":"Update cPanel account password","tags":["UserManager","Account Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  change_password \\\n  oldpass='MyPreviousPassword' \\\n  newpass='MyUpdatedPassword'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/change_password?oldpass=12346=newpass=ThisIs4It!","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_change_password.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_change_password.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/UserManager/,\n    q/change_password/,\n    {\n        'oldpass' => 'PreviousPassword',\n        'newpass' => 'B3tt3rP4ssw0rd!',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_change_password.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_change_password.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    'UserManager',\n    'change_password',\n    array (\n        'oldpass' => 'PreviousPassword',\n        'newpass' => 'B3tt3rP4ssw0rd!',\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}"}]}}},"x-tagGroups":[{"name":"cPanel Account","tags":["Account Management"]}],"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.115.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"create_user":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{"CreateUserResponse":{"allOf":[{"$ref":"#/components/schemas/SubaccountBase"},{"properties":{"dismissed_merge_candidates":{"description":"An array of objects containing service candidates that the system dismissed from merges.","items":{"$ref":"#/components/schemas/SubaccountBase"},"type":"array"},"invite_expiration":{"description":"When the invitation expires. A date in Unix time format.","format":"unix_timestamp","example":"1591718154","type":"integer"},"has_invite":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether an account login invitation exists.\n* `1` - Account invitation exists.\n* `0` - Account invitation does **not** exist."},"has_expired_invite":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether an expired account login invitation exists.\n* `1` - Expired account invitation exists.\n* `0` - Expired account invitation does **not** exist."},"merge_candidates":{"type":"array","items":{"$ref":"#/components/schemas/SubaccountBase"},"description":"An array of objects that represents the service accounts that the system could merge for\nthis subaccount."}},"type":"object"}]},"SubaccountBase":{"type":"object","properties":{"domain":{"format":"domain","description":"The subaccount user's associated domain.","example":"example.com","type":"string"},"special":{"description":"Whether the account is a system-created special account that the user **cannot** remove.\n* `1` - A special account.\n* `0` - **Not** a special account.","example":"1","enum":["0","1"],"type":"integer"},"username":{"description":"The subaccount's username.","example":"example","type":"string"},"has_siblings":{"description":"Whether the service account shares a `full_username` value with another service account.\n* `1` - Shares.\n* `0` - Does **not** share.","example":"0","enum":["0","1"],"type":"integer"},"can_set_quota":{"enum":["0","1"],"example":"0","description":"Whether the cPanel account user can change the subaccount's disk usage quota.\n* `1` - Can change.\n* `0` - **Cannot** change.","type":"integer"},"real_name":{"example":"John Doe","description":"The name of the subaccount's user, if provided.","type":"string"},"guid":{"type":"string","description":"The subaccount unique identifier.","example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4"},"full_username":{"type":"string","example":"user@example.com","description":"The subaccount's username and domain name.","format":"email"},"parent_type":{"description":"The type of account that could own the service account.\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** yet exist, but the user could create as part of a merge.\n* `null` - **Not** a merge candidate.","example":"hypothetical","nullable":"true","type":"string"},"avatar_url":{"type":"string","example":"https://img.example.com/avatars/example.jpg","description":"The HTTPS URL to the user's subaccount profile photo image file.","format":"url"},"sub_account_exists":{"nullable":"true","enum":["0","1"],"example":"0","description":"Whether a subaccount exists with the same username.\n* `1` - Exists.\n* `0` - Does not exist.\n\n**Note:**\n\nThe function returns a null value if the account is **not** a service account.","type":"integer"},"type":{"type":"string","description":"The type of account.\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does not exist, but that the user could create as part of a merge.\n* `service` - A service account.\n* `cpanel` - The cPanel account.","example":"sub","enum":["sub","hypothetical","service","cpanel"]},"alternate_email":{"description":"An alternate email address for the subaccount's user.","format":"email","example":"user@example.com","type":"string"},"dismissed":{"enum":["0","1"],"example":"1","description":"Whether the cPanel account user dismissed the merge prompt for the service account.\n\n* `1` - Dismissed.\n* `0` - Did **not** dismiss.\n\n**Note:**\n\n**Only** service accounts return this value.","type":"integer"},"phone_number":{"type":"string","description":"The subaccount user's phone number. A valid phone number that conforms to\n[ITU-T](https://en.wikipedia.org/wiki/ITU-T)'s\n[E.164](https://en.wikipedia.org/wiki/E.164)-recommended standard for the representation\nof telephone numbers.","example":"+15551234567"},"can_set_password":{"type":"integer","description":"Whether the cPanel account user can change the subaccount's password.\n* `1` - Can change.\n* `0` - **Cannot** change.\n\n**Note:**\n\n  The function returns a `0` value for subaccounts that inherit their password from the cPanel account.","example":"1","enum":["0","1"]},"can_delete":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the cPanel account user can delete the subaccount.\n* `1` - Can delete.\n* `0` - **Cannot** delete."},"issues":{"items":{"properties":{"area":{"type":"string","example":"quota","description":"The affected section of cPanel & WHM."},"limit":{"description":"The set quota megabyte (MB) limit for the affected subaccount.","example":"1500","type":"integer","minimum":"1"},"type":{"type":"string","example":"info","enum":["error","warning","info"],"description":"The type of issue.\n* `error`\n* `warning`\n* `info`"},"used":{"example":"2000","description":"The number of megabytes (MB) that the account currently uses.","minimum":"1","type":"integer"},"service":{"type":"string","example":"email","enum":["email","ftp","webdisk"],"description":"The affected service.\n* `email`\n* `ftp`\n* `webdisk`"},"message":{"description":"The description of the issue.","example":"Your account is over quota.","type":"string"}},"type":"object"},"description":"Information about any issues or problems with the subaccount.","type":"array"},"synced_password":{"type":"integer","nullable":"true","enum":["0","1"],"example":"0","description":"Whether the user has synchronized the passwords for each of the subaccount's service accounts.\n* `1` - Synchronized.\n* `0` - **Not** synchronized.\n\n**Note:**\n\nThe function returns a null value if the account is **not** a subaccount."},"services":{"properties":{"ftp":{"type":"object","properties":{"homedir":{"type":"string","description":"The subaccount's FTP home directory, relative to the cPanel account's home directory.","format":"path","example":"/subaccount"},"quota":{"description":"The subaccount's maximum FTP disk space quota, in megabytes (MB).\n* A string containing a non-negative float.\n* `0.00` - Unlimited.","example":"0.00","type":"string"},"enabled":{"enum":["0","1"],"example":"0","description":"Whether the subaccount can access FTP.\n* `1` - Can access.\n* `0` - **Cannot** access.","type":"integer"}},"description":"Information about the subaccount's FTP status."},"email":{"description":"Information about the subaccount's email status.","properties":{"enabled":{"description":"Whether the subaccount can access Webmail, POP, and IMAP services.\n* `1` - Can access.\n* `0` - **Cannot** access.","example":"1","enum":["0","1"],"type":"integer"},"quota":{"example":"1500","description":"The maximum amount of disk space, in megabytes (MB), allocated to subaccount's email account.","minimum":"1","type":"integer"}},"type":"object"},"webdisk":{"description":"Information about the subaccount's Web Disk status.","type":"object","properties":{"perms":{"example":"rw","description":"Whether the subaccount has read-only or read and write permissions.\n\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.","type":"string"},"homedir":{"example":"/bob","format":"path","description":"The subaccount's Web Disk home directory, relative to the cPanel account's home directory.","type":"string"},"enabled":{"description":"Whether the subaccount can access Web Disk.\n* `1` - Can access.\n* `0` - **Cannot** access.","example":"0","enum":["0","1"],"type":"integer"},"private":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the subaccount's Web Disk directory permissions are public or private.\n\n* `1` - Private (`0700`).\n* `0` - Public (`0755`)."}}}},"type":"object","description":"Information about the subaccount's access to email, FTP, and Web Disk."}}}}},"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/UserManager/create_user":{"get":{"summary":"Create Subaccount","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  create_user \\\n  domain='example.com' \\\n  password='123456luggage' \\\n  username='example'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/create_user?domain=example.com&password=123456luggage&username=example"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_create_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_create_user.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/UserManager/,\n    q/create_user/,\n    {\n        'domain' => 'example.com',\n        'password' => '123456luggage',\n        'username' => 'example',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_create_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_create_user.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    'UserManager',\n    'create_user',\n    array (\n        'domain' => 'example.com',\n        'password' => '123456luggage',\n        'username' => 'example',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["UserManager","Subaccount Management"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"create_user"},"module":{"type":"string","example":"UserManager","description":"The name of the module called."},"result":{"properties":{"metadata":{"properties":{}},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"$ref":"#/components/schemas/CreateUserResponse"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","parameters":[{"in":"query","name":"alternate_email","required":"false","description":"An alternate email address for the Subaccount's user.\n\n**Note:**\n\n You **must** use this parameter if you set the `send_invite` value to `1`.","schema":{"type":"string","default":null,"format":"email","example":"user@example.com"}},{"name":"avatar_url","in":"query","required":"false","description":"The URL path to the user's Subaccount profile photo.\n\n**Note:**\n\nYou **must** use the HTTPS protocol to prevent mixed content warnings when users view the image from another HTTPS URL.\n\n**Warning:**\n\nWe reserved this parameter for future use. Do **not** use this parameter.","schema":{"type":"string","example":"https://img.example.com/avatars/example.jpg","format":"url","default":null}},{"schema":{"type":"string","example":"example.com","format":"domain"},"description":"The Subaccount user's associated domain that the cPanel account owns.","required":"true","name":"domain","in":"query"},{"description":"The Subaccount's password.\n\n**Note:**\n\n Email, FTP, and Web Disk services use this password.","schema":{"type":"string","format":"password","example":"123456luggage"},"in":"query","name":"password","required":"true"},{"description":"A phone number for the Subaccount user that conforms to\n[ITU-T](https://en.wikipedia.org/wiki/ITU-T)'s [E.164](https://en.wikipedia.org/wiki/E.164)\nstandards.\n\n**Warning:**\n\nWe reserved this parameter for future use. Do **not** use this parameter.","schema":{"example":"+15551234567","default":null,"type":"string"},"in":"query","name":"phone_number","required":"false"},{"description":"The Subaccount user's first and/or last name.","schema":{"type":"string","default":null,"example":"John Doe"},"in":"query","name":"real_name","required":"false"},{"schema":{"type":"integer","default":"0","enum":["0","1"],"example":"0"},"description":"Whether to send a reset password email to the Subaccount's alternate email address.\n\n* `1` - Send.\n* `0` - Do not send.","required":"false","in":"query","name":"send_invite"},{"in":"query","name":"services.email.enabled","required":"false","description":"Whether to grant the Subaccount email access.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","schema":{"type":"integer","enum":["0","1"],"example":"1","default":"0"}},{"schema":{"type":"string","example":"500"},"description":"The maximum amount of disk space, in megabytes (MB), allocated to Subaccount's email account.\n\n* `0` or `unlimited` - The subaccount has unlimited disk space.\n\nThis value defaults to the defined system value.\n\n**Note:**\n\nThis value **cannot** be larger than the system's maximum email quota.","required":"false","in":"query","name":"services.email.quota"},{"in":"query","name":"services.email.send_welcome_email","required":"false","description":"Whether to send client configuration instructions to the account.\n\n* `1` - Send the instructions.\n* `0` - Do **not** send the instructions.","schema":{"type":"integer","example":"1","enum":["0","1"],"default":"0"}},{"in":"query","name":"services.ftp.enabled","required":"false","description":"Whether to grant the Subaccount FTP access.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","schema":{"type":"integer","enum":["0","1"],"example":"1","default":"0"}},{"required":"false","in":"query","name":"services.ftp.homedir","schema":{"format":"path","example":"/Subaccount","type":"string"},"description":"The Subaccount's FTP home directory, relative to the cPanel account's home directory.\n\n**Note:**\n\n* This parameter is **required** if you enabled the `services.ftp.homedir` parameter.\n* The directory **must** exist."},{"description":"Whether to grant the Subaccount Web Disk access.\n\n* `1` _ Can access.\n* `0` - **Cannot** access.","schema":{"enum":["0","1"],"example":"1","default":"0","type":"integer"},"in":"query","name":"services.webdisk.enabled","required":"false"},{"description":"Whether to enable the Web Disk Digest Authentication.\n\n* `1` - Enabled.\n* `0` - Disabled.\n\n**Note:**\n\n* **Only** enable Digest Authentication for clients that require additional compatibility support on\n  certain versions of Windows® operating systems. This compatibility support is **only** required on servers\n  that use a self-signed certificate for the `cpsrvd` and `cpdavd` daemons.\n* We recommend that you do **not** use Digest Authentication.","schema":{"default":"0","enum":["0","1"],"example":"0","type":"integer"},"in":"query","name":"services.webdisk.enabledigest","required":"false"},{"required":"false","in":"query","name":"services.webdisk.private","schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"},"description":"Whether to set the directory's permissions to public or private.\n\n* `1` - Private (`0700`).\n* `0` - Public (`0755`)."},{"description":"The Subaccount's Web Disk home directory, relative to the cPanel account's home directory.\n\n**Note:**\n\nThis parameter is **required** if you enable the `services.webdisk.enabled` parameter.","schema":{"example":"/Subaccount","format":"path","type":"string"},"in":"query","name":"services.webdisk.homedir","required":"false"},{"name":"services.webdisk.perms","in":"query","required":"false","description":"The Subaccount's file permissions for its Web Disk home directory.\n\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.\n\n**Note:**\n\n The `services.webdisk.homedir` parameter determines the Subaccount's Web Disk home directory.","schema":{"default":"rw","example":"rw","type":"string"}},{"required":"false","name":"type","in":"query","schema":{"type":"string","enum":["sub"],"example":"sub","default":"sub"},"description":"The type of account.\n\n* `sub` - A Subaccount."},{"required":"true","name":"username","in":"query","schema":{"type":"string","maxLength":"64","format":"username","example":"example"},"description":"The username for the Subaccount. The username can only contain alphanumeric characters, dots (`.`), hyphens (`-`), and underscores (`_`).\n\n**Note:**\n\nThis value does **not** include the domain name."}],"description":"This function creates a Subaccount.","operationId":"UserManager::create_user"}}},"x-tagGroups":[{"name":"cPanel Account","tags":["Subaccount Management"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The UserManager module for UAPI.","name":"UserManager"},{"description":"cPanel Account / Subaccount Management","name":"Subaccount Management"}]},"check_account_conflicts":{"tags":[{"name":"UserManager","description":"The UserManager module for UAPI."},{"name":"Subaccount Management","description":"cPanel Account / Subaccount Management"}],"servers":[{"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."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Subaccount Management"],"name":"cPanel Account"}],"paths":{"/UserManager/check_account_conflicts":{"get":{"parameters":[{"required":"true","name":"full_username","in":"query","schema":{"type":"string","format":"email","example":"username@example.com"},"description":"The Subaccount's username and domain name."}],"operationId":"check_account_conflicts","description":"This function lists the other Subaccounts or services accounts that conflict\nwith the specified username.\n\n**Note:**\n\nIf the function returns more than one account, it will return some values\nmultiple times within the return arrays.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"check_account_conflicts","type":"string"},"module":{"type":"string","example":"UserManager","description":"The name of the module called."},"result":{"properties":{"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"accounts":{"description":"An object containing the service accounts that match the queried `full_username` parameter.","type":"object","properties":{"can_set_password":{"type":"integer","example":"1","enum":["1","0"],"description":"Whether the cPanel account user can change the Subaccount's\npassword.\n\n* `1` — Can change the password.\n* `0` — **Cannot** change the password.\n\n**Note:**\n\nthe function returns `0` for Subaccounts that inherit their password\nfrom the cPanel account."},"dismissed":{"enum":["1","0"],"example":"1","description":"Whether the cPanel account user dismissed the merge prompt\nfor the service account.\n\n* `1` — Dismissed.\n* `0` — Did **not** dismiss.\n\n**Note:**\n\n**Only** service accounts return this value.","type":"integer"},"alternate_email":{"example":"user@example.com","format":"email","description":"An alternate email address for the Subaccount's user.","nullable":"true","type":"string"},"invite_expiration":{"description":"The time at which the new Subaccount invitation will expire.\n\n* `null` — The account does **not** own an active invitation.","format":"unix_timestamp","example":"1600162200","nullable":"true","type":"integer"},"dismissed_merge_candidates":{"type":"array","description":"A list of the service accounts that the user dismissed the merge\nprompt for.\n\n**Note:**\n\n* This array **always** returns empty.\n* We reserved this return for future use."},"issues":{"type":"array","items":{"type":"object","properties":{"area":{"example":"info","description":"The affected section of cPanel & WHM.","type":"string"},"limit":{"type":"integer","minimum":"1","description":"The set megabyte (MB) quota limit for the affected Subaccount.","example":"1500"},"type":{"description":"The type of issue.\n\n* `error`\n* `warning`\n* `info`","enum":["error","warning","info"],"example":"info","type":"string"},"service":{"type":"string","description":"The affected service.\n\n* `email`\n* `ftp`\n* `webdisk`","enum":["email","ftp","webdisk"],"example":"email"},"used":{"minimum":"1","type":"integer","description":"The number of megabytes (MB) the account currently uses.","example":"2000"},"message":{"type":"string","description":"A description of the issue.","example":"Your account is over quota."}}},"description":"An array of objects containing information about any issues or problems with the Subaccount."},"can_delete":{"description":"Whether the cPanel account user can delete the Subaccount.\n\n* `1` — Can delete.\n* `0` — **Cannot** delete.","enum":["1","0"],"example":"0","type":"integer"},"guid":{"type":"string","example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4","description":"The Subaccount's system-assigned unique identifier."},"can_set_quota":{"example":"0","enum":["1","0"],"description":"Whether the cPanel account user can change the Subaccount's\ndisk usage quota.\n\n* `1` — Can change the Subaccount's disk usage quota.\n* `0` — **Cannot** change the Subaccount's disk useage quota.","type":"integer"},"has_siblings":{"type":"integer","description":"Whether the service account shares the queried `full_username` value\nwith another service account.\n\n* `1` — Shares the service account.\n* `0` — Does **not** share the service account.","example":"0","enum":["1","0"]},"domain":{"format":"domain","description":"The Subaccount user's associated domain.","example":"example.com","type":"string"},"has_invite":{"description":"Whether the Subaccount owns an active invitation.\n\n* `1` — Own an active invitation.\n* `0` — Does **not** own an active invitation.","example":"0","enum":["1","0"],"type":"integer"},"has_expired_invite":{"example":"0","enum":["1","0"],"description":"Whether the Subaccount owns an expired invitation.\n\n* `1` — Owns an expired invitation.\n* `0` — Does **not** own an expired invitation.","type":"integer"},"merge_candidates":{"type":"array","description":"An array of objects containing the service accounts that the system could merge for this Subaccount.","items":{"properties":{"phone_number":{"type":"string","description":"The Subaccount user's phone number, in\n[ITU-T-recommended E.164](https://en.wikipedia.org/wiki/E.164)\nformat.","example":"+15551234567"},"real_name":{"example":"John Doe","description":"The name of the Subaccount user, if provided.","type":"string"},"username":{"format":"username","description":"The username for the Subaccount.\n\n**Note:**\n\nThis value does **not** include the domain name.","example":"username","type":"string"},"type":{"example":"sub","enum":["sub","hypothetical","service","cpanel"],"description":"The type of account.\n\n* `sub` — A Subaccount.\n* `hypothetical` — A hypothetical Subaccount that does **not**\nyet exist, but that the user could create as part of a merge.\n* `service` — A service account.\n* `cpanel` — A cPanel account.","type":"string"},"special":{"type":"integer","description":"Whether the account is a system-created special account that\nthe user **cannot** remove.\n\n* `1` — The user can remove the account.\n* `0` — The user **cannot** remove the account.","enum":["1","0"],"example":"1"},"sub_account_exists":{"type":"integer","nullable":"true","description":"Whether a Subaccount exists with the same username.\n\n* `1` — Exists.\n* `0` — Does **not** exist.\n* `null` — The account is **not** a Subaccount.","example":"0","enum":["1","0"]},"services":{"properties":{"ftp":{"description":"Information about the Subaccount's FTP status.","type":"object","properties":{"homedir":{"type":"string","description":"The Subaccount's FTP directory, relative to the cPanel account's home directory.","example":"/Subaccount"},"quota":{"minimum":"0","type":"integer","example":"100","description":"The Subaccount's FTP maximum disk space quota, in\nmegabytes (MB).\n\n* `0` — The account has an unlimited disk space quota."},"enabled":{"type":"integer","description":"Whether the Subaccount can access FTP.\n\n* `1` — Has FTP service access.\n* `0` — Does **not** have FTP service access.","enum":["1","0"],"example":"0"}}},"email":{"type":"object","properties":{"enabled":{"description":"Whether the Subaccount can access Webmail, POP, and\nIMAP services.\n\n* `1` — Has service access.\n* `0` — Does **not** have service access.","example":"1","enum":["1","0"],"type":"integer"},"quota":{"description":"The Subaccount's email disk space quota, in megabytes (MB).\n\n* `0` — The account has an unlimited email disk space quota.","example":"100","type":"integer","maximum":"999999","minimum":"0"}},"description":"Information that indicates the Subaccount's email status."},"webdisk":{"type":"object","properties":{"enabled":{"type":"integer","enum":["1","0"],"example":"0","description":"Whether the Subaccount can access Web Disk.\n\n* `1` — Has Web Disk service access.\n* `0` — Does **not** have Web Disk service access."},"private":{"type":"integer","description":"Whether the Web Disk directory permissions are public\nor private.\n\n* `1` — Private (`0700`).\n* `0` — Public (`0755`).","example":"0","enum":["1","0"]},"homedir":{"example":"/username","description":"The Subaccount's Web Disk directory, relative to the cPanel account's home directory.","type":"string"},"perms":{"description":"Whether the Web Disk has read or read and write\npermissions.\n\n* `ro` — Read-only permissions.\n* `rw` — Read and write permissions.","enum":["ro","rw"],"example":"rw","type":"string"}},"description":"Information about the Subaccount's Web Disk status."}},"type":"object","description":"Information about the Subaccount's access to email, FTP, and Web Disk."},"synced_password":{"type":"integer","nullable":"true","example":"0","enum":["1","0"],"description":"Whether the user has synchronized the passwords for each of\nthe Subaccount's service accounts.\n\n* `1` — Synchronized.\n* `0` — **Not** synchronized.\n* `null` — The account is **not** a Subaccount."},"parent_type":{"description":"The type of account that could own the service account.\n\n* `sub` — A Subaccount.\n* `hypothetical` — A hypothetical Subaccount that does **not**\nyet exist, but that the user could create as part of a merge.\n* `null` — **Not** a merge candidate.","enum":["sub","hypothetical"],"nullable":"true","type":"string"}},"type":"object"}},"avatar_url":{"type":"string","nullable":"true","description":"The URL to the user's Subaccount profile image file.","format":"url","example":"https://img.example.com/avatars/example.jpg"},"full_username":{"type":"string","example":"username@example.com","description":"The Subaccount's username.","format":"email"}}},"conflict":{"type":"integer","enum":["1","0"],"example":"1","description":"Whether the system detected an account conflict.\n\n* `1` — Conflict.\n* `0` — **No** conflict."}}},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"],"type":"integer"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","tags":["UserManager","Subaccount Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  check_account_conflicts \\\n  full_username='username@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/check_account_conflicts?full_username=username%40example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_check_account_conflicts.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_check_account_conflicts.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/UserManager/,\n    q/check_account_conflicts/,\n    {\n        'full_username' => 'username@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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_check_account_conflicts.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_check_account_conflicts.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    'UserManager',\n    'check_account_conflicts',\n    array (\n        'full_username' => 'username@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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return Subaccounts and service accounts conflicts"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"list_users":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"x-tagGroups":[{"tags":["Subaccount Management"],"name":"cPanel Account"}],"paths":{"/UserManager/list_users":{"get":{"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"type":"array"},"data":{"properties":{},"type":"array","items":{"properties":{"can_set_password":{"description":"Whether the cPanel account user can change the subaccount's password.\n* `1` - Can change.\n* `0` - **Cannot** change.\n\n**Note:**\n\n  The function returns a `0` value for subaccounts that inherit their password from the cPanel account.","example":"1","enum":["0","1"],"type":"integer"},"phone_number":{"type":"string","example":"+15551234567","description":"The subaccount user's phone number. A valid phone number that conforms to [ITU-T](https://en.wikipedia.org/wiki/ITU-T)'s [E.164](https://en.wikipedia.org/wiki/E.164) -recommended standard for the representation of telephone numbers."},"type":{"type":"string","example":"sub","enum":["sub","hypothetical","service","cpanel"],"description":"The type of account.\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does not exist, but that the user could create as part of a merge.\n* `service` - A service account.\n* `cpanel` - The cPanel account."},"invite_expiration":{"type":"integer","format":"unix_timestamp","description":"When the invitation expires.","example":"1591718154"},"services":{"type":"object","properties":{"webdisk":{"description":"An object containing information that indicates the subaccount's Web Disk status.","type":"object","properties":{"private":{"description":"Whether to set the Web Disk directory's permissions to public or private.\n* `1` - Private (0700).\n* `0` - Public (0755).","example":"0","enum":["0","1"],"type":"integer"},"enabled":{"description":"Whether the subaccount can access Web Disk.\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"0","type":"integer"},"homedir":{"example":"/bob","format":"path","description":"The subaccount's Web Disk home directory relative to the cPanel account's home directory.","type":"string"},"perms":{"type":"string","description":"Whether to grant write permissions to the subaccount.\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.","example":"rw","enum":["ro","rw"]}}},"special":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the account is a system-created special account that the user cannot remove.\n* `1` - A special account.\n* `0` - **Not** a special account."},"email":{"type":"object","properties":{"enabled":{"type":"integer","description":"Whether the subaccount can access Webmail, POP, and IMAP services.\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"1"},"quota":{"example":"100","format":"megabytes","description":"The maximum amount of disk space allocated to subaccount's email account.","minimum":"1","type":"integer"}},"description":"An object containing the information that indicates the subaccount's email status."},"ftp":{"type":"object","properties":{"enabled":{"type":"integer","description":"Whether the subaccount can access FTP.\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"0"},"quota":{"example":"100","description":"The subaccount's FTP disk space quota.\n* `0` - Unlimited.","format":"megabytes","maximum":"999999","type":"integer","minimum":"0"},"homedir":{"format":"path","description":"The subaccount's FTP home directory relative to the cPanel account's home.","example":"/subaccount","type":"string"}},"description":"An object containing the information that indicates the subaccount's FTP status."}},"description":"An object containing information about the subaccount's access to email, FTP, and Web Disk."},"issues":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string","example":"email","enum":["email","ftp","webdisk"],"description":"The affected service."},"used":{"type":"integer","format":"megabytes","description":"The number of megabytes (MB) that the account currently uses.","example":"2000"},"message":{"type":"string","description":"The description of the issue.","example":"Your account is over quota."},"area":{"type":"string","description":"The affected section of cPanel & WHM.","example":"quota"},"type":{"example":"info","enum":["error","warning","info"],"description":"The type of issue.","type":"string"},"limit":{"type":"integer","minimum":"1","example":"1500","description":"The set quota megabyte (MB) limit for the affected subaccount.","format":"megabytes"}}},"description":"Information about any issues or problems with the subaccount."},"dismissed_merge_candidates":{"example":[],"items":{"type":"string"},"description":"An array of objects containing information about service candidates that the system dismissed from merges.","type":"array"},"real_name":{"example":"John Doe","description":"The name of the subaccount's user.","type":"string"},"has_siblings":{"description":"Whether the service account shares a full_username value with another service account.\n* `1` - Shares.\n* `0` - Does **not** share.","enum":["0","1"],"example":"0","type":"integer"},"domain":{"format":"domain","description":"The subaccount user's associated domain.","example":"example.com","type":"string"},"avatar_url":{"type":"string","format":"url","description":"The user's subaccount profile photo.","example":"https://img.example.com/avatars/example.jpg"},"dismissed":{"type":"integer","description":"Whether the cPanel account user dismissed the merge prompt for the service account.\n* `1` - Dismissed.\n* `0` - Did **not** dismiss.\n\n**Note:**\n\n **Only** service accounts return this value.","enum":["0","1"],"example":"1"},"alternate_email":{"type":"string","example":"user@example.com","description":"An alternate email address for the subaccount's user.","format":"email"},"synced_password":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the user has synchronized the passwords for each of the subaccount's service accounts.\n* `1` - Synchronized.\n* `0` - Not synchronized.\n\n**Note:**\n\nThe function returns a `null` value if the account is **not** a subaccount.","nullable":"true"},"can_delete":{"type":"integer","description":"Whether the cPanel account user can delete the subaccount.\n* `1` - Can delete.\n* `0` - **Cannot** delete.","example":"0","enum":["0","1"]},"guid":{"type":"string","example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4","description":"The subaccount unique identifier."},"can_set_quota":{"description":"Whether the cPanel account user can change the subaccount's disk usage quota.\n* `1` - Can change.\n* `0` - **Cannot** change.","enum":["0","1"],"example":"0","type":"integer"},"username":{"example":"example","description":"The username for the subaccount. A username that meets the subaccount name limitations.\n- Length  64 characters.\n- Characters  a-z, A-Z, 0-9, dot (.), hyphen (-), underscore (_).\n\n**Note:**\n\nThis value does **not** include the domain name.","minLength":"1","type":"string","maxLength":"64","pattern":"^[\\w\\.]{1,64}$"},"special":{"description":"Whether the account is a system-created special account that the user **cannot** remove.\n* `1` — A special account.\n* `0` — **Not** a special account.","example":"0","enum":["0","1"],"type":"integer"},"has_invite":{"type":"integer","description":"Whether an account login invitation exists.\n* `1` - Account invitation exists.\n* `0` - Account invitation does **not** exist.","enum":["0","1"],"example":"0"},"has_expired_invite":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether an expired account login invitation exists.\n* `1` - Expired account invitation exists.\n* `0` - Expired account invitation does **not** exist."},"sub_account_exists":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether a subaccount exists with the same username.\n* `1` - Exists.\n* `0` - Does **not** exist.\n\n**Note:**\n\nThe function returns a `null` value if the account is **not** a service account.","nullable":"true"},"merge_candidates":{"example":[],"items":{"type":"string"},"description":"An array of objects that represents the service accounts that the system could merge for this subaccount.","type":"array"},"parent_type":{"type":"string","nullable":"true","description":"The type of account that could own the service account.\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** yet exist, but the user could create as part of a merge.\n* `null` - **Not** a merge candidate.","enum":["sub","hypothetical"],"example":"hypothetical"},"full_username":{"description":"The subaccount's username and domain name.","example":"user@example.com","type":"string"}},"type":"object"}},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"UserManager","description":"The name of the module called.","type":"string"},"func":{"example":"list_users","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"UserManager-list_users","description":"This function lists the cPanel account's Subaccounts.","parameters":[{"name":"flat","in":"query","required":"false","description":"Whether to return Subaccounts with the same name under the merge_candidates array.\n* `1` - Do **not** return.\n* `0` - Return.","schema":{"default":"0","example":"0","enum":["0","1"],"type":"integer"}}],"x-cpanel-api-version":"UAPI","summary":"Return cPanel account's Subaccounts","tags":["UserManager","Subaccount Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  list_users\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/list_users"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_list_users.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_list_users.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/UserManager/,\n    q/list_users/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_list_users.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_list_users.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    'UserManager',\n    'list_users'\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"tags":[{"description":"The UserManager module for UAPI.","name":"UserManager"},{"description":"cPanel Account / Subaccount Management","name":"Subaccount Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}]},"lookup_user":{"x-tagGroups":[{"tags":["Subaccount Management"],"name":"cPanel Account"}],"paths":{"/UserManager/lookup_user":{"get":{"summary":"Return Subaccount's information","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  lookup_user \\\n  guid='EXAMPLE1:EXAMPLE.COM:564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/lookup_user?guid=EXAMPLE1%3aEXAMPLE.COM%3a564CD663%253AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_lookup_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_lookup_user.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/UserManager/,\n    q/lookup_user/,\n    {\n        'guid' => 'EXAMPLE1:EXAMPLE.COM:564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_lookup_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_lookup_user.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    'UserManager',\n    'lookup_user',\n    array (\n        'guid' => 'EXAMPLE1:EXAMPLE.COM:564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37',\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}"}],"tags":["UserManager","Subaccount Management"],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"lookup_user","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"data":{"allOf":[{"$ref":"#/components/schemas/ServiceAccount"},{"properties":{"has_expired_invite":{"example":"0","enum":["0","1"],"description":"Whether an expired account login invitation exists.\n* `1` - Expired account invitation exists.\n* `0` - Expired account invitation does not exist.","type":"integer"},"has_invite":{"type":"integer","description":"Whether an account login invitation exists.\n* `1` -  Account invitation exists.\n* `0` -  Account invitation does not exist.","enum":["0","1"],"example":"0"},"dismissed_merge_candidates":{"description":"An array of service account objects that the system dismissed from merges.","items":{"$ref":"#/components/schemas/ServiceAccount"},"type":"array"},"invite_expiration":{"example":"1591718154","format":"unix_timestamp","description":"When the invitation expires.","nullable":"true","type":"integer"}}},{"type":"object"}]},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"UserManager","description":"The name of the module called.","type":"string"}},"type":"object"}}}}},"operationId":"lookup_user","description":"This function lists a single Subaccount's information.","parameters":[{"in":"query","name":"guid","required":"true","description":"The Subaccount's unique identifier.","schema":{"example":"EXAMPLE1:EXAMPLE.COM:564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37","type":"string"}}]}}},"tags":[{"name":"UserManager","description":"The UserManager module for UAPI."},{"description":"cPanel Account / Subaccount Management","name":"Subaccount Management"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"components":{"schemas":{"ServiceAccount":{"type":"object","properties":{"services":{"properties":{"email":{"description":"Information that indicates the subaccount's email status.","properties":{"quota":{"description":"The maximum amount of disk space allocated to subaccount's email account, in megabytes (MB).","example":"100","type":"integer","minimum":"0"},"enabled":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the subaccount can access Webmail, POP, and IMAP services.\n* `1` - Can access.\n* `0` - Cannot access."}},"type":"object"},"special":{"description":"Whether the account is a system-created special account that the user cannot remove.\n* `1` - A special account.\n* `0` - Not a special account.","enum":["0","1"],"example":"1","type":"integer"},"webdisk":{"description":"This object contains information that indicates the subaccount's Web Disk status.","properties":{"private":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether to set the Web Disk directory's permissions to public or private.\n* `1` - Private (0700).\n* `0` - Public (0755)."},"enabled":{"type":"integer","description":"Whether the subaccount can access Web Disk.\n* `1` - Can access.\n* `0` - Cannot access.","enum":["0","1"],"example":"0"},"perms":{"type":"string","enum":["ro","rw"],"example":"rw","description":"Whether to grant write permissions to the subaccount.\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions."},"homedir":{"format":"path","description":"The subaccount's Web Disk home directory, relative to the cPanel account's home directory.","example":"/bob","type":"string"},"enabledigest":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the subaccount's Web Disk service has enabled Digest Authentication.\n* `1` - Digest Authentication is enabled.\n* `0` - Digest Authentication is not enabled."}},"type":"object"},"ftp":{"description":"This object contains the information that indicates the subaccount's FTP status.","properties":{"enabled":{"type":"integer","description":"Whether the subaccount can access FTP.\n* `1` - Can access.\n* `0` - Cannot access.","example":"0","enum":["0","1"]},"quota":{"description":"The subaccount's FTP disk space quota.\n* `1` to `999999` - The maximum disk space that the subaccount may use, in megabytes (MB).\n* `0` - Unlimited.","example":"100","minimum":"0","type":"integer","maximum":"999999"},"homedir":{"example":"/subaccount","description":"The subaccount's FTP home directory, relative to the cPanel account's home directory.","format":"path","type":"string"}},"type":"object"}},"type":"object","description":"Information about the subaccount's access to email, FTP, and Web Disk."},"issues":{"items":{"properties":{"type":{"description":"The type of issue.","enum":["error","info","warning"],"example":"info","type":"string"},"limit":{"example":"1500","description":"The set quota megabyte (MB) limit for the affected subaccount.","minimum":"0","type":"integer"},"area":{"description":"The affected section of cPanel & WHM.","example":"quota","type":"string"},"message":{"type":"string","description":"The description of the issue.","example":"Your account is over quota."},"service":{"description":"The affected service.","enum":["email","ftp","webdisk"],"example":"email","type":"string"},"used":{"example":"2000","description":"The number of megabytes (MB) that the account currently uses.","type":"integer","minimum":"0"}},"type":"object"},"description":"Information about any issues or problems with the subaccount.","type":"array"},"can_delete":{"description":"Whether the cPanel account user can delete the subaccount.\n* `1` - Can delete.\n* `0` - Cannot delete.","enum":["0","1"],"example":"0","type":"integer"},"synced_password":{"description":"Whether the user has synchronized the passwords for each of the subaccount's service accounts.\n* `1` - Synchronized.\n* `0` - Not synchronized.\n\n**Note:**\n\n  The function returns a null value if the account is not a subaccount.","enum":["0","1"],"example":"0","type":"integer"},"dismissed":{"type":"integer","description":"Whether the cPanel account user dismissed the merge prompt for the service account.\n* `1` - Dismissed.\n* `0` - Did not dismiss.\n\n**Note:**\n\n  Only service accounts return this value.","enum":["0","1"],"example":"1"},"can_set_password":{"description":"Whether the cPanel account user can change the subaccount's password.\n* `1` - Can change.\n* `0` - Cannot change.\n\n**Note:**\n\n  The function returns a `0` value for subaccounts that inherit their password from the cPanel account.","example":"1","enum":["0","1"],"type":"integer"},"phone_number":{"example":"+15551234567","description":"The subaccount user's phone number. A valid phone number that conforms to [ITU-T's E.164-recommended standard](https://en.wikipedia.org/wiki/ITU-T) for the representation of telephone numbers.","nullable":"true","type":"string"},"type":{"description":"The type of account.\n* `cpanel` - The cPanel account.\n* `hypothetical` - A hypothetical subaccount that does not exist, but that the user could create as part of a merge.\n* `service` - A service account.\n* `sub` - A subaccount.","example":"sub","enum":["cpanel","hypothetical","service","sub"],"type":"string"},"alternate_email":{"nullable":"true","format":"email","description":"An alternate email address for the subaccount's user.","example":"user@example.com","type":"string"},"merge_candidates":{"items":{"$ref":"#/components/schemas/ServiceAccount"},"description":"An array of service account objects that the system could merge for this subaccount.","type":"array"},"sub_account_exists":{"type":"integer","description":"Whether a subaccount exists with the same username.\n* `1` - Exists.\n* `0` - Does not exist.\n\n**Note:**\n\n  The function returns a null value if the account is not a service account.","enum":["0","1"],"example":"0"},"avatar_url":{"type":"string","nullable":"true","example":"https://img.example.com/avatars/example.jpg","format":"url","description":"The user's subaccount profile photo."},"full_username":{"example":"user@example.com","description":"The subaccount's username and domain name. A valid username, the `@` character, and the associated domain.","type":"string"},"parent_type":{"nullable":"true","enum":["sub","hypothetical"],"example":"hypothetical","description":"The type of account that could own the service account.\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does not yet exist, but the user could create as part of a merge.\n* `null` - Not a merge candidate.","type":"string"},"real_name":{"nullable":"true","example":"John Doe","description":"The name of the subaccount's user.\n* A first name, a last name, or a first name and last name.\n* An empty or null string.","type":"string"},"guid":{"type":"string","description":"The subaccount unique identifier.","example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4"},"domain":{"nullable":"true","description":"The subaccount user's associated domain.","format":"domain","example":"example.com","type":"string"},"special":{"example":"0","enum":["0","1"],"description":"Whether the account is a system-created special account that the user **cannot** remove.\n* `1` - A special account.\n* `0` - Not a special account.","type":"integer"},"has_siblings":{"example":"0","enum":["0","1"],"description":"Whether the service account shares a `full_username` value with another service account.\n* `1` - Shares.\n* `0` - Does not share.","type":"integer"},"username":{"example":"example","format":"username","description":"The username for the subaccount.","type":"string"},"can_set_quota":{"type":"integer","description":"Whether the cPanel account user can change the subaccount's disk usage quota.\n* `1` - Can change.\n* `0` - Cannot change.","enum":["0","1"],"example":"0"}}}},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2"},"unlink_service_account":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/UserManager/unlink_service_account":{"get":{"parameters":[{"description":"The subaccount's username.\n\n**Note:**\n\nThis value does **not** include the domain name.","schema":{"format":"username","example":"example","type":"string"},"in":"query","name":"username","required":"true"},{"required":"true","in":"query","name":"domain","schema":{"type":"string","example":"example.com","format":"domain"},"description":"The subaccount's associated domain."},{"required":"true","in":"query","name":"service","schema":{"enum":["email","ftp","webdisk"],"example":"ftp","type":"string"},"description":"The service to unlink.\n\n* `email`\n* `ftp`\n* `webdisk`"},{"schema":{"example":"0","enum":["0","1"],"default":"0","type":"integer"},"description":"Whether to dismiss the service account as a merge candidate.\n* `1` - Dismiss as merge candidate.\n* `0` - Display as merge candidate.\n\n**Note:**\n\n If any email, FTP, or Web Disk accounts use the same username, cPanel's [*User Manager*](https://go.cpanel.net/cpaneldocsUserManager) interface (*cPanel >> Home >> Preferences >> User Manager*) allows you to merge those accounts into a subaccount.","required":"false","in":"query","name":"dismiss"}],"description":"This function unlinks a service account from a subaccount.","operationId":"unlink_service_account","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"unlink_service_account","description":"The name of the method called."},"module":{"example":"UserManager","description":"The name of the module called.","type":"string"},"result":{"properties":{"data":{"default":null,"nullable":"true","type":"object"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","tags":["UserManager","Subaccount Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  unlink_service_account \\\n  username='example' \\\n  domain='example.com' \\\n  service='ftp'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/unlink_service_account?username=example&domain=example.com&service=ftp"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_unlink_service_account.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_unlink_service_account.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/UserManager/,\n    q/unlink_service_account/,\n    {\n        'username' => 'example',\n        'domain' => 'example.com',\n        'service' => 'ftp',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_unlink_service_account.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_unlink_service_account.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    'UserManager',\n    'unlink_service_account',\n    array (\n        'username' => 'example',\n        'domain' => 'example.com',\n        'service' => 'ftp',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Unregister service account from Subaccount"}}},"x-tagGroups":[{"tags":["Subaccount Management"],"name":"cPanel Account"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"UserManager","description":"The UserManager module for UAPI."},{"description":"cPanel Account / Subaccount Management","name":"Subaccount Management"}]},"dismiss_merge":{"tags":[{"description":"The UserManager module for UAPI.","name":"UserManager"},{"name":"Subaccount Management","description":"cPanel Account / Subaccount Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Subaccount Management"],"name":"cPanel Account"}],"paths":{"/UserManager/dismiss_merge":{"get":{"description":"This function removes a service account as a link candidate to create a subaccount or\nlink to a subaccount. When you use this function, the system removes the *Link* option in\ncPanel's [*User Manager*](https://go.cpanel.net/cpaneldocsUserManager) interface (_cPanel >> Home >> Preferences >> User Manager_).\n\n**Note:**\n\nYou **must** use at least one of the following parameters:\n* `services.email.dismiss`\n* `services.ftp.dismiss`\n* `services.webdisk.dismiss`","operationId":"dismiss_merge","parameters":[{"schema":{"example":"example1","format":"username","type":"string","maxLength":"64"},"description":"The username for the service account.\n\n**Note:**\n\nThis parameter does **not** include the domain name.","required":"true","in":"query","name":"username"},{"description":"The service account's associated domain.","schema":{"type":"string","example":"example.com","format":"domain"},"name":"domain","in":"query","required":"true"},{"in":"query","name":"services.email.dismiss","required":"false","description":"Whether to dismiss the merge of the email service account.\n\n* `1` - Dismiss.\n* `0` - Do **not** dismiss.","schema":{"type":"integer","default":"0","enum":["0","1"],"example":"1"}},{"in":"query","name":"services.ftp.dismiss","required":"false","description":"Whether to dismiss the merge of the FTP service account.\n\n* `1` - Dismiss.\n* `0` - Do **not** dismiss.","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"}},{"required":"false","in":"query","name":"services.webdisk.dismiss","schema":{"example":"1","enum":["0","1"],"default":"0","type":"integer"},"description":"Whether to dismiss the merge of the Web Disk service account.\n\n* `1` - Dismiss.\n* `0` - Do **not** dismiss."}],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}},"type":"object"},"module":{"type":"string","example":"UserManager","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"dismiss_merge"}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  dismiss_merge \\\n  username='example1' \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/dismiss_merge?username=example1&domain=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_dismiss_merge.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_dismiss_merge.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/UserManager/,\n    q/dismiss_merge/,\n    {\n        'username' => 'example1',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_dismiss_merge.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_dismiss_merge.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    'UserManager',\n    'dismiss_merge',\n    array (\n        'username' => 'example1',\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}"}],"tags":["UserManager","Subaccount Management"],"summary":"Remove service account link request","x-cpanel-api-version":"UAPI"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"delete_user":{"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The UserManager module for UAPI.","name":"UserManager"},{"description":"cPanel Account / Subaccount Management","name":"Subaccount Management"}],"paths":{"/UserManager/delete_user":{"get":{"description":"This function deletes a Subaccount. This function returns only metadata if no other service accounts exist with the same username and domain.\n* If one service account uses the same username and domain, the function returns the service account's information.\n* If two or more service accounts use the same username and domain, the function returns a hypothetical Subaccount.\n\n**Note:**\n\n* A hypothetical Subaccount consists of two or more service accounts that use the same username and domain.\n* This function returns only metadata if the specified username and domain do **not** match any service accounts or hypothetical Subaccounts.","operationId":"UserManager::delete_user","parameters":[{"schema":{"type":"string","maxLength":"64","example":"example"},"description":"The Subaccount's username.\n* Characters — `a-z`, `A-Z`, `0-9`, dot (`.`), hyphen (`-`), underscore (`_`)\n\n**Note:**\n\nThis value does **not** include the domain name.","required":"true","name":"username","in":"query"},{"schema":{"type":"string","example":"example.com","format":"domain"},"description":"The Subaccount's associated domain.  The domain **must** be one that the cPanel account owns.","required":"true","name":"domain","in":"query"}],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"UserManager","description":"The name of the module called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"data":{"properties":{"real_name":{"example":"John Doe","description":"The name of the account's user.\n* A first name, a last name, or a first name and last name.\n* An empty string.","type":"string"},"domain":{"type":"string","description":"The account user's associated domain.","format":"domain","example":"example.com"},"has_siblings":{"enum":["0","1"],"example":"0","description":"Whether the service account shares a `full_username` value with another service account.\n* `1` - Shares.\n* `0` - Does not share.","type":"integer"},"avatar_url":{"description":"The user's account profile photo.  The URL must point to an image file.","format":"url","example":"https://img.example.com/avatars/example.jpg","type":"string"},"phone_number":{"type":"string","description":"The account user's phone number.\n* A valid phone number that conforms to [ITU-T](https://en.wikipedia.org/wiki/ITU-T)'s [E.164-recommended standard](https://en.wikipedia.org/wiki/E.164) for the representation of telephone numbers.","example":"+15551234567"},"can_set_password":{"type":"integer","description":"Whether the cPanel account user can change the account's password.\n* `1` - Can change password.\n* `0` - **Cannot** change password.\n\n**Note:**\n\nThe function returns `0` for accounts that inherit their password from the cPanel account.","enum":["0","1"],"example":"1"},"invite_expiration":{"nullable":"true","example":"1466258282","format":"unix_timestamp","description":"The time at which the new Subaccount invitation will expire, given as a valid Unix epoch time or null.\n\nIf the account does not own an active invitation, this value returns `null`.","type":"integer"},"type":{"example":"service","enum":["hypothetical","service"],"description":"The type of account.\n* `hypothetical` - A hypothetical account that does not exist, but that the user could create as part of a merge.\n* `service` - A service account.","type":"string"},"services":{"properties":{"ftp":{"type":"object","properties":{"homedir":{"type":"string","format":"path","description":"The account's FTP home directory.\n* A valid path, relative to the cPanel account's home directory.","example":"/account"},"quota":{"minimum":"0","type":"integer","example":"100","description":"The account's FTP disk space quota.\n* An integer that represents the account's maximum FTP disk usage, in megabytes (MB).\n* `0` - Unlimited."},"enabled":{"description":"Whether the account can access FTP.\n* `1` - Can access.\n* `0` - **Cannot** access.","example":"0","enum":["1","0"],"type":"integer"}},"description":"Information about the account's FTP status."},"email":{"description":"Information that indicates the account's email status.","properties":{"enabled":{"enum":["1","0"],"example":"1","description":"Whether the account can access Webmail, POP, and IMAP services.\n* `1` - Can access.\n* `0` - **Cannot** access.","type":"integer"},"quota":{"minimum":"0","maximum":"999999","type":"integer","example":"100","description":"The account's email disk space quota.\n* The set quota megabyte (MB) limit for the account's email disk space.\n* `0` - Unlimited."}},"type":"object"},"webdisk":{"description":"Information about the account's Web Disk status.","type":"object","properties":{"enabled":{"type":"integer","description":"Whether the account can access Web Disk.\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["1","0"],"example":"0"},"private":{"type":"integer","example":"0","enum":["1","0"],"description":"Whether to set the Web Disk directory's permissions to public or private.\n* `1` - Private (0700).\n* `0` - Public (0755)."},"perms":{"example":"rw","description":"Whether to grant write permissions to the account.\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.","type":"string"},"homedir":{"example":"/bob","description":"The account's Web Disk directory.\n* A valid path, relative to the cPanel account's home directory.","format":"path","type":"string"}}}},"type":"object","description":"Information about the account's access to email, FTP, and Web Disk."},"issues":{"type":"array","items":{"properties":{"limit":{"description":"The set quota megabyte (MB) limit for the affected account.","example":"1500","type":"integer","minimum":"0"},"type":{"example":"info","enum":["error","warning","info"],"description":"The type of issue.\n* `error`\n* `warning`\n* `info`","type":"string"},"area":{"type":"string","example":"quota","description":"The affected section of cPanel & WHM."},"message":{"example":"Your account is over quota.","description":"The description of the issue.","type":"string"},"used":{"description":"The number of megabytes (MB) that the account currently uses.","example":"2000","type":"integer","minimum":"0"},"service":{"type":"string","enum":["email","ftp","webdisk"],"example":"email","description":"The affected service.\n* `email`\n* `ftp`\n* `webdisk`"}}},"description":"Information about any issues or problems with the account."},"dismissed_merge_candidates":{"type":"array","description":"An array of objects that represent the service accounts that the user dismissed the merge prompt for.\nThis array will always return empty.\n\n**Note:**\n\nWe reserved this return for future use.","items":{"type":"object"}},"guid":{"example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4","description":"The account unique identifier.","type":"string"},"special":{"description":"Whether the account is a system-created special account that the user **cannot** remove.\n* `1` - A special account.\n* `0` - **Not** a special account.","example":"1","enum":["1","0"],"type":"integer"},"username":{"description":"The account username.\n\nThe username must meet the account name limitations.\n* Characters - `a-z`, `A-Z`, `0-9`, dot (`.`), hyphen (`-`), underscore (`_`)\n\n**Note::**\n\nThis value does **not** include the domain name.","format":"username","maxLength":"64","type":"string"},"can_set_quota":{"description":"Whether the cPanel account user can change the account's disk usage quota.\n* `1` - Can change quota.\n* `0` - **Cannot** change quota.","example":"0","enum":["0","1"],"type":"integer"},"merge_candidates":{"items":{"type":"object","properties":{"synced_password":{"type":"integer"},"can_delete":{"type":"integer"},"alternate_email":{"type":"string"},"dismissed":{"type":"integer"},"parent_type":{"type":"string"},"full_username":{"type":"string"},"has_expired_invite":{"type":"integer"},"has_invite":{"type":"integer"},"sub_account_exists":{"type":"integer"},"merge_candidates":{"items":{"type":"string"},"type":"array"},"username":{"format":"username","type":"string"},"can_set_quota":{"type":"integer"},"special":{"type":"integer"},"guid":{"type":"string"},"issues":{"type":"array","items":{"type":"string"}},"dismissed_merge_candidates":{"items":{"type":"string"},"type":"array"},"services":{"type":"object"},"type":{"type":"string"},"invite_expiration":{"type":"integer"},"can_set_password":{"type":"integer"},"phone_number":{"type":"string"},"avatar_url":{"type":"string"},"has_siblings":{"type":"integer"},"domain":{"format":"domain","type":"string"},"real_name":{"type":"string"}}},"description":"The service accounts that the system could merge for this account.\n\n**Note:**\n\nYou can find descriptions for this array's returns within this table.","type":"array"},"sub_account_exists":{"type":"integer","enum":["1","0"],"example":"0","description":"Whether an account exists with the same username.\n* `1` - Exists.\n* `0` - Does not exist.\n* `null` - The account is **not** a service account.","nullable":"true"},"has_invite":{"example":"0","enum":["0","1"],"description":"Whether the Subaccount owns an active invitation.\n* `1` - Owns an invitation.\n* `0` - Does **not** own an invitation.","type":"integer"},"has_expired_invite":{"description":"Whether the Subaccount owns an expired invitation.\n* `1` - Owns an expired invitation.\n* `0` - Does **not** own an expired invitation.","example":"0","enum":["0","1"],"type":"integer"},"parent_type":{"type":"string","nullable":"true","description":"The type of account that could own the service account.\n* `sub` - An account.\n* `hypothetical` - A hypothetical account does **not** yet exist, but that the user could create as part of a merge.\n* `null` - **Not** a merge candidate.","example":"hypothetical","enum":["sub","hypothetical"]},"full_username":{"type":"string","example":"user@example.com","description":"The account's username and domain name, separated by the `@` character."},"dismissed":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the cPanel account user dismissed the merge prompt for the service account.\n* `1` - Dismissed prompt.\n* `0` - Did **not** dismiss prompt.\n\n**Note:**\n\n**Only** service accounts return this value."},"alternate_email":{"example":"user@example.com","format":"email","description":"An alternate email address for the account's user.","type":"string"},"can_delete":{"description":"Whether the cPanel account user can delete the account.\n* `1` - Can delete.\n* `0` - **Cannot** delete.","example":"0","enum":["0","1"],"type":"integer"},"synced_password":{"nullable":"true","enum":["1","0"],"example":"0","description":"Whether the user has synchronized the passwords for each of the account's service accounts.\n* `1` - Synchronized.\n* `0` - **Not** synchronized.\n* `null` - The account is **not** a Subaccount","type":"integer"}},"type":"object"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{}},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"},"func":{"type":"string","example":"delete_user","description":"The name of the method called."}}}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  delete_user \\\n  username='example' \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/delete_user?username=example&domain=example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_delete_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_delete_user.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/UserManager/,\n    q/delete_user/,\n    {\n        'username' => 'example',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_delete_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_delete_user.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    'UserManager',\n    'delete_user',\n    array (\n        'username' => 'example',\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}"}],"tags":["UserManager","Subaccount Management"],"summary":"Delete Subaccount","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Subaccount Management"],"name":"cPanel Account"}]},"merge_service_account":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"tags":[{"name":"UserManager","description":"The UserManager module for UAPI."},{"name":"Subaccount Management","description":"cPanel Account / Subaccount Management"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"cPanel Account","tags":["Subaccount Management"]}],"paths":{"/UserManager/merge_service_account":{"get":{"description":"This function links service accounts to subaccounts and creates a subaccount if one does not exist.\n\n**Note:**\n\nYou can only link email, FTP, or Web Disk accounts.\n\n**Important**\n\nYou must use at least **one** of the following parameters:\n\n* services.email.merge\n* services.ftp.merge\n* services.webdisk.merge\n\nTo link multiple service accounts, the service accounts **must** share the same username and domain.","operationId":"merge_service_account","parameters":[{"schema":{"format":"username","example":"example","type":"string"},"description":"The username for the service account that meets the account name limitations.\n\n* Length - 64 characters\n* Characters — `a-z`, `A-Z`, `0-9`, dot (`.`), hyphen (`-`), underscore (`_`).\n\n**Note:**\n\nThis value does **not** include the domain name.","required":"true","name":"username","in":"query"},{"in":"query","name":"domain","required":"true","description":"The service account's associated domain.","schema":{"type":"string","example":"example.com","format":"domain"}},{"name":"services.email.merge","in":"query","required":"false","description":"Whether to link the email account to the subaccount.\n\n* `1` - Merge.\n* `0` - Do **not** merge.","schema":{"type":"integer","default":"0","enum":["0","1"],"example":"1"}},{"in":"query","name":"services.ftp.merge","required":"false","description":"Whether to link the FTP account to the subaccount.\n\n* `1` - Merge.\n* `0` - Do **not** merge.","schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"}},{"required":"false","in":"query","name":"services.webdisk.merge","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"description":"Whether to link the Web Disk account to the subaccount.\n\n* `1` - Merge.\n* `0` - Do **not** merge."}],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"merge_service_account","description":"The name of the method called."},"module":{"description":"The name of the module called.","example":"UserManager","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"username":{"type":"string","example":"example","description":"The username for the subaccount.\n\nThe username for the service account that meets the account name limitations.\n\n* Length - 64 characters\n* Characters — `a-z`, `A-Z`, `0-9`, dot (`.`), hyphen (`-`), underscore (`_`).\n\n**Note:**\n\nThis value does **not** include the domain name.","format":"username"},"can_set_quota":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the cPanel account user can change the subaccount's disk usage quota.\n* `1` - Can change.\n* `0` - **Cannot** change."},"special":{"example":"1","enum":["0","1"],"description":"Whether the account is a system-created special account that the user **cannot** remove.\n* `1` - A special account.\n* `0` - **Not** a special account.","type":"integer"},"guid":{"example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4","description":"The subaccount unique identifier. The system assigned unique value.","type":"string"},"full_username":{"type":"string","format":"email","description":"The subaccount's username and domain name.","example":"user@example.com"},"parent_type":{"example":"hypothetical","enum":["sub","hypothetical"],"description":"The type of account that could own the service account.\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** yet exist, but the user could create as part of a merge.\n* `null` - Not a merge candidate.","nullable":"true","type":"string"},"has_invite":{"description":"Whether an account login invitation exists.\n* `1` - Account invitation exists.\n* `0` - Account invitation does **not** exist.","example":"0","enum":["0","1"],"type":"integer"},"has_expired_invite":{"description":"Whether an expired account login invitation exists.\n* `1` - Expired account invitation exists.\n* `0` - Expired account invitation does **not** exist.","enum":["0","1"],"example":"0","type":"integer"},"merge_candidates":{"description":"An array of objects that represents the service accounts that the system could merge for this subaccount.","items":{"type":"object","properties":{"real_name":{"type":"string","example":"John Doe","description":"The name of the subaccount's user.\n\n* A first name.\n* Last name.\n* First name and last name.\n* An empty string."},"guid":{"type":"string","example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4","description":"The subaccount unique identifier. The system assigned unique value."},"special":{"type":"integer","description":"Whether the account is a system-created special account that the user **cannot** remove.\n* `1` - A special account.\n* `0` - **Not** a special account.","example":"1","enum":["0","1"]},"domain":{"type":"string","format":"domain","description":"The subaccount user's associated domain. A domain that the cPanel account owns.","example":"example.com"},"can_set_quota":{"description":"Whether the cPanel account user can change the subaccount's disk usage quota.\n* `1` - Can change.\n* `0` - **Cannot** change.","example":"0","enum":["0","1"],"type":"integer"},"username":{"type":"string","example":"example","description":"The username for the service account that meets the account name limitations.\n\n* Length - 64 characters\n* Characters — `a-z`, `A-Z`, `0-9`, dot (`.`), hyphen (`-`), underscore (`_`).\n\n**Note:**\n\nThis value does **not** include the domain name.","format":"username"},"has_siblings":{"type":"integer","description":"Whether the service account shares a `full_username` value with another service account.\n* `1` - Shares.\n* `0` - Does **not** share.","enum":["0","1"],"example":"0"},"sub_account_exists":{"enum":["0","1"],"example":"0","description":"Whether a subaccount exists with the same username.\n\n* `1` - Exists.\n* `0` - Does **not** exist.\n\n**Note:**\n\nThe function returns a `null` value if the account is **not** a service account.","nullable":"true","type":"integer"},"avatar_url":{"format":"url","description":"The user's subaccount profile photo.","example":"https://img.example.com/avatars/example.jpg","type":"string"},"full_username":{"type":"string","description":"The subaccount's username and domain name.","format":"email","example":"user@example.com"},"parent_type":{"example":"hypothetical","enum":["sub","hypothetical"],"description":"The type of account that could own the service account.\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** yet exist, but the user could create as part of a merge.\n* `null` - Not a merge candidate.","nullable":"true","type":"string"},"can_set_password":{"description":"Whether the cPanel account user can change the subaccount's password.\n* `1` - Can change.\n* `0` - **Cannot** change.\n\n**Note:**\n\nThe function returns a `0` value for subaccounts that inherit their password from the cPanel account.","example":"1","enum":["0","1"],"type":"integer"},"phone_number":{"description":"The subaccount user's phone number.","example":"+15551234567","type":"string"},"type":{"enum":["sub","hypothetical","service","cpanel"],"example":"sub","description":"The type of account.\n\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** exist, but that the user could create as part of a merge.\n* `service` - A service account.\n* `cpanel` - The cPanel account.","type":"string"},"alternate_email":{"type":"string","example":"user@example.com","format":"email","description":"An alternate email address for the subaccount's user."},"services":{"properties":{"ftp":{"properties":{"enabled":{"enum":["0","1"],"example":"0","description":"Whether the subaccount can access FTP.\n* `1` - Can access.\n* `0` - **Cannot** access.","type":"integer"},"quota":{"example":"100","description":"The subaccount's FTP disk space quota.\n* >= `1` - Represents the maximum disk space that the subaccount may use, in megabytes (MB).\n* `0`   - Unlimited.","maximum":"999999","type":"integer","minimum":"0"},"homedir":{"type":"string","example":"/subaccount","format":"path","description":"The subaccount's FTP home directory."}},"type":"object","description":"This object contains the information that indicates the subaccount's FTP status."},"webdisk":{"description":"This object contains information that indicates the subaccount's Web Disk status.","type":"object","properties":{"perms":{"example":"rw","description":"Whether to grant write permissions to the subaccount.\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.","type":"string"},"homedir":{"type":"string","example":"/bob","description":"The subaccount's Web Disk home directory.","format":"path"},"enabled":{"type":"integer","description":"Whether the subaccount can access Web Disk.\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"0"},"private":{"description":"Whether to set the Web Disk directory's permissions to public or private.\n* `1` - Private (0700).\n* `0` - Public (0755).","enum":["0","1"],"example":"0","type":"integer"}}},"email":{"properties":{"enabled":{"description":"Whether the subaccount can access Webmail, POP, and IMAP services.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"1","type":"integer"},"quota":{"description":"The maximum amount of disk space allocated to subaccount's email account. A positive integer that represents the maximum disk space that the subaccount may use, in megabytes (MB).\n\n**Note:**\n\nThis function will **not** return `0` as a value.","example":"100","type":"integer"}},"type":"object","description":"This object contains the information that indicates the subaccount's email status."}},"type":"object","description":"This object contains information about the subaccount's access to email, FTP, and Web Disk."},"issues":{"type":"array","items":{"properties":{"area":{"example":"quota","description":"The affected section of cPanel & WHM.","type":"string"},"limit":{"minimum":"1","type":"integer","example":"1500","description":"The set quota megabyte (MB) limit for the affected subaccount."},"type":{"type":"string","enum":["error","warning","info"],"example":"info","description":"The type of issue.\n\n* `error`\n* `warning`\n* `info`"},"used":{"minimum":"1","type":"integer","description":"The number of megabytes (MB) that the account currently uses.","example":"2000"},"service":{"description":"The affected service.\n* `email`\n* `ftp`\n* `webdisk`","enum":["email","ftp","webdisk"],"example":"email","type":"string"},"message":{"type":"string","example":"Your account is over quota.","description":"The description of the issue."}},"type":"object"},"description":"Information about any issues or problems with the subaccount."},"can_delete":{"type":"integer","description":"Whether the cPanel account user can delete the subaccount.\n* `1` - Can delete.\n* `0` - **Cannot** delete.","example":"0","enum":["0","1"]},"synced_password":{"type":"integer","nullable":"true","enum":["0","1"],"example":"0","description":"Whether the user has synchronized the passwords for each of the subaccount's service accounts.\n\n* `1` - Synchronized.\n* `0` - **Not** synchronized.\n\n**Note:**\n\nThe function returns a `null` value if the account is **not** a subaccount."}}},"type":"array"},"sub_account_exists":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether a subaccount exists with the same username.\n\n* `1` - Exists.\n* `0` - Does **not** exist.\n\n**Note:**\n\nThe function returns a `null` value if the account is **not** a service account.","nullable":"true"},"alternate_email":{"type":"string","example":"user@example.com","format":"email","description":"An alternate email address for the subaccount's user."},"dismissed":{"enum":["0","1"],"example":"1","description":"Whether the cPanel account user dismissed the merge prompt for the service account.\n\n**Note:**\n\nOnly service accounts return this value.\n* `1` - Dismissed.\n* `0` - Did **not** dismiss.","type":"integer"},"synced_password":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether the user has synchronized the passwords for each of the subaccount's service accounts.\n\n* `1` - Synchronized.\n* `0` - **Not** synchronized.\n\n**Note:**\n\nThe function returns a `null` value if the account is **not** a subaccount.","nullable":"true"},"can_delete":{"enum":["0","1"],"example":"0","description":"Whether the cPanel account user can delete the subaccount.\n* `1` - Can delete.\n* `0` - **Cannot** delete.","type":"integer"},"has_siblings":{"type":"integer","description":"Whether the service account shares a `full_username` value with another service account.\n* `1` - Shares.\n* `0` - Does **not** share.","example":"0","enum":["0","1"]},"domain":{"example":"example.com","format":"domain","description":"The subaccount user's associated domain. A domain that the cPanel account owns.","type":"string"},"real_name":{"description":"The name of the subaccount's user.\n\n* A first name.\n* Last name.\n* First name and last name.\n* An empty string.","example":"John Doe","type":"string"},"avatar_url":{"type":"string","example":"https://img.example.com/avatars/example.jpg","format":"url","description":"The user's subaccount profile photo."},"invite_expiration":{"type":"integer","description":"When the invitation expires.","format":"unix_timestamp","example":"1591718154"},"type":{"example":"sub","description":"The type of account.\n\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** exist, but that the user could create as part of a merge.\n* `service` - A service account.\n* `cpanel` - The cPanel account.","type":"string"},"can_set_password":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the cPanel account user can change the subaccount's password.\n* `1` - Can change.\n* `0` - **Cannot** change.\n\n**Note:**\n\nThe function returns a `0` value for subaccounts that inherit their password from the cPanel account."},"phone_number":{"type":"string","description":"The subaccount user's phone number.","example":"+15551234567"},"dismissed_merge_candidates":{"items":{"type":"object","properties":{"synced_password":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the user has synchronized the passwords for each of the subaccount's service accounts.\n\n* `1` - Synchronized.\n* `0` - **Not** synchronized.\n\n**Note:**\n\nThe function returns a `null` value if the account is **not** a subaccount.","nullable":"true"},"issues":{"items":{"type":"object","properties":{"type":{"type":"string","description":"The type of issue.\n\n* `error`\n* `warning`\n* `info`","example":"info","enum":["error","warning","info"]},"limit":{"type":"integer","minimum":"1","description":"The set quota megabyte (MB) limit for the affected subaccount.","example":"1500"},"area":{"type":"string","example":"quota","description":"The affected section of cPanel & WHM."},"message":{"type":"string","description":"The description of the issue.","example":"Your account is over quota."},"service":{"type":"string","example":"email","enum":["email","ftp","webdisk"],"description":"The affected service.\n* `email`\n* `ftp`\n* `webdisk`"},"used":{"type":"integer","minimum":"1","description":"The number of megabytes (MB) that the account currently uses.","example":"2000"}}},"description":"Information about any issues or problems with the subaccount.","type":"array"},"can_delete":{"enum":["0","1"],"example":"0","description":"Whether the cPanel account user can delete the subaccount.\n* `1` - Can delete.\n* `0` - **Cannot** delete.","type":"integer"},"services":{"properties":{"ftp":{"description":"This object contains the information that indicates the subaccount's FTP status.","type":"object","properties":{"quota":{"type":"integer","maximum":"999999","minimum":"0","description":"The subaccount's FTP disk space quota.\n* >= `1` - Represents the maximum disk space that the subaccount may use, in megabytes (MB).\n* `0`   - Unlimited.","example":"100"},"enabled":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the subaccount can access FTP.\n* `1` - Can access.\n* `0` - **Cannot** access."},"homedir":{"format":"path","description":"The subaccount's FTP home directory.","example":"/subaccount","type":"string"}}},"webdisk":{"description":"This object contains information that indicates the subaccount's Web Disk status.","type":"object","properties":{"enabled":{"example":"0","enum":["0","1"],"description":"Whether the subaccount can access Web Disk.\n* `1` - Can access.\n* `0` - **Cannot** access.","type":"integer"},"private":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether to set the Web Disk directory's permissions to public or private.\n* `1` - Private (0700).\n* `0` - Public (0755)."},"homedir":{"example":"/bob","description":"The subaccount's Web Disk home directory.","format":"path","type":"string"},"perms":{"type":"string","description":"Whether to grant write permissions to the subaccount.\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.","enum":["ro","rw"],"example":"rw"}}},"email":{"properties":{"quota":{"description":"The maximum amount of disk space allocated to subaccount's email account. A positive integer that represents the maximum disk space that the subaccount may use, in megabytes (MB).\n\n**Note:**\n\nThis function will **not** return `0` as a value.","example":"100","type":"integer"},"enabled":{"type":"integer","description":"Whether the subaccount can access Webmail, POP, and IMAP services.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","example":"1","enum":["0","1"]}},"type":"object","description":"This object contains the information that indicates the subaccount's email status."}},"type":"object","description":"This object contains information about the subaccount's access to email, FTP, and Web Disk."},"alternate_email":{"description":"An alternate email address for the subaccount's user.","format":"email","example":"user@example.com","type":"string"},"type":{"example":"sub","enum":["sub","hypothetical","service","cpanel"],"description":"The type of account.\n\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** exist, but that the user could create as part of a merge.\n* `service` - A service account.\n* `cpanel` - The cPanel account.","type":"string"},"can_set_password":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the cPanel account user can change the subaccount's password.\n* `1` - Can change.\n* `0` - **Cannot** change.\n\n**Note:**\n\nThe function returns a `0` value for subaccounts that inherit their password from the cPanel account."},"phone_number":{"description":"The subaccount user's phone number.","example":"+15551234567","type":"string"},"full_username":{"type":"string","description":"The subaccount's username and domain name.","format":"email","example":"user@example.com"},"parent_type":{"description":"The type of account that could own the service account.\n* `sub`          - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does not yet exist, but the user could create as part of a merge.\n* `null`         - **Not** a merge candidate.","example":"hypothetical","enum":["sub","hypothetical"],"nullable":"true","type":"string"},"sub_account_exists":{"description":"Whether a subaccount exists with the same username.\n\n* `1` - Exists.\n* `0` - Does **not** exist.\n\n**Note:**\n\nThe function returns a `null` value if the account is not a service account.","example":"0","enum":["0","1"],"nullable":"true","type":"integer"},"avatar_url":{"example":"https://img.example.com/avatars/example.jpg","description":"The user's subaccount profile photo.","format":"url","type":"string"},"has_siblings":{"example":"0","enum":["0","1"],"description":"Whether the service account shares a `full_username` value with another service account.\n* `1` - Shares.\n* `0` - Does **not** share.","type":"integer"},"username":{"type":"string","example":"example","description":"The username for the subaccount.","format":"username"},"can_set_quota":{"example":"0","enum":["0","1"],"description":"Whether the cPanel account user can change the subaccount's disk usage quota.\n* `1` - Can change.\n* `0` - **Cannot** change.","type":"integer"},"domain":{"format":"domain","description":"The subaccount user's associated domain that the cPanel account owns.","example":"example.com","type":"string"},"special":{"description":"Whether the account is a system-created special account that the user **cannot** remove.\n* `1` - A special account.\n* `0` - **Not** a special account.","example":"1","enum":["0","1"],"type":"integer"},"guid":{"type":"string","example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4","description":"The subaccount unique identifier. The system assigned unique value."},"real_name":{"type":"string","description":"The name of the subaccount's user.\n\n* A first name.\n* Last name.\n* First name and last name.\n* An empty string.","example":"John Doe"}}},"description":"An array of objects of service candidates that the system dismissed from merges.","type":"array"},"issues":{"description":"Information about any issues or problems with the subaccount.","items":{"properties":{"message":{"type":"string","example":"Your account is over quota.","description":"The description of the issue."},"used":{"type":"integer","minimum":"1","example":"2000","description":"The number of megabytes (MB) that the account currently uses."},"service":{"type":"string","enum":["email","ftp","webdisk"],"example":"email","description":"The affected service.\n* `email`\n* `ftp`\n* `webdisk`"},"limit":{"minimum":"1","type":"integer","example":"1500","description":"The set quota megabyte (MB) limit for the affected subaccount."},"type":{"enum":["error","warning","info"],"example":"info","description":"The type of issue.\n\n* `error`\n* `warning`\n* `info`","type":"string"},"area":{"example":"quota","description":"The affected section of cPanel & WHM.","type":"string"}},"type":"object"},"type":"array"},"services":{"properties":{"webdisk":{"description":"This object contains information that indicates the subaccount's Web Disk status.","properties":{"homedir":{"type":"string","description":"The subaccount's Web Disk home directory.","format":"path","example":"/bob"},"perms":{"description":"Whether to grant write permissions to the subaccount.\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.","example":"rw","type":"string"},"enabled":{"enum":["0","1"],"example":"0","description":"Whether the subaccount can access Web Disk.\n* `1` - Can access.\n* `0` - **Cannot** access.","type":"integer"},"private":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether to set the Web Disk directory's permissions to public or private.\n* `1` - Private (0700).\n* `0` - Public (0755)."}},"type":"object"},"email":{"type":"object","properties":{"enabled":{"description":"Whether the subaccount can access Webmail, POP, and IMAP services.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"1","type":"integer"},"quota":{"description":"The maximum amount of disk space allocated to subaccount's email account. A positive integer that represents the maximum disk space that the subaccount may use, in megabytes (MB).\n\n**Note:**\n\nThis function will **not** return `0` as a value.","example":"100","type":"integer"}},"description":"This object contains the information that indicates the subaccount's email status."},"ftp":{"properties":{"quota":{"type":"integer","maximum":"999999","minimum":"0","description":"The subaccount's FTP disk space quota.\n* >= `1` - Represents the maximum disk space that the subaccount may use, in megabytes (MB).\n* `0`   - Unlimited.","example":"100"},"enabled":{"type":"integer","description":"Whether the subaccount can access FTP.\n* `1` - Can access.\n* `0` - **Cannot** access.","enum":["0","1"],"example":"0"},"homedir":{"example":"/subaccount","description":"The subaccount's FTP home directory.","format":"path","type":"string"}},"type":"object","description":"This object contains the information that indicates the subaccount's FTP status."}},"type":"object","description":"This object contains information about the subaccount's access to email, FTP, and Web Disk."}}},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["UserManager","Subaccount Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  merge_service_account \\\n  username='example' \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/merge_service_account?username=example&domain=example.com","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_merge_service_account.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_merge_service_account.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/UserManager/,\n    q/merge_service_account/,\n    {\n        'username' => 'example',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_merge_service_account.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_merge_service_account.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    'UserManager',\n    'merge_service_account',\n    array (\n        'username' => 'example',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Register service account to Subaccount"}}}},"lookup_service_account":{"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{"LookupServiceAccountSubaccountMergeCandidates":{"properties":{"merge_candidates":{"description":"An array of objects that represents the service accounts that the system could merge for this subaccount.","items":{"allOf":[{"$ref":"#/components/schemas/LookupServiceAccountSubaccountBase"},{"$ref":"#/components/schemas/LookupServiceAccountSubaccountMergeCandidatesEmpty"}]},"type":"array"}},"type":"object"},"LookupServiceAccountSubaccountBase":{"properties":{"can_set_password":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the cPanel account user can change the subaccount's password.\n\n* `1` - Can change.\n* `0` - **Cannot** change.\n\n**Note:**\n\n  The function returns a `0` value for subaccounts that inherit their password from the cPanel account."},"phone_number":{"description":"The subaccount user's phone number.\n\nThe number conforms to the [ITU-T](https://en.wikipedia.org/wiki/ITU-T)'s [E.164](https://en.wikipedia.org/wiki/E.164)-recommended standard for the representation of telephone numbers.","example":"+15551234567","type":"string"},"invite_expiration":{"example":"1591718154","format":"unix_timestamp","description":"When the invitation expires.","type":"integer"},"type":{"type":"string","description":"The type of account.\n\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** exist, but that the user could create as part of a merge.\n* `service` - A service account.\n* `cpanel` - The cPanel account.","example":"sub"},"services":{"description":"This object contains information about the subaccount's access to email, FTP, and Web Disk.","type":"object","properties":{"email":{"properties":{"quota":{"description":"The maximum amount of disk space, in megabytes (MB), allocated to the subaccount's email account.\n\n**Note:**\n\n  This function will not return `0` as a value.","example":"100","type":"integer"},"enabled":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the subaccount can access Webmail, POP, and IMAP services.\n\n* `1` - Can access.\n* `0` - **Cannot** access."}},"type":"object","description":"This object contains the information that indicates the subaccount's email status."},"webdisk":{"description":"This object contains information that indicates the subaccount's Web Disk status.","type":"object","properties":{"private":{"description":"Whether to set the Web Disk directory's permissions to public or private.\n\n* `1` - Private (`0700`).\n* `0` - Public (`0755`).","example":"0","enum":["0","1"],"type":"integer"},"enabled":{"enum":["0","1"],"example":"0","description":"Whether the subaccount can access Web Disk.\n\n* `1` - Can access.\n* `0` - **Cannot** access.","type":"integer"},"perms":{"description":"Whether to grant write permissions to the subaccount.\n\n* `ro` - Read-only permissions.\n* `rw` - Read and write permissions.","enum":["ro","rw"],"example":"rw","type":"string"},"homedir":{"format":"path","description":"The subaccount's Web Disk home directory.","example":"/bob","type":"string"}}},"ftp":{"description":"This object contains the information that indicates the subaccount's FTP status.","type":"object","properties":{"homedir":{"type":"string","example":"/subaccount","description":"The subaccount's FTP home directory.","format":"path"},"quota":{"type":"integer","example":"100","description":"The maximum amount disk space, in megabytes (MB), that the subaccount may use.\n\n* A positive integer between `1` and `999999`\n* `0` - Unlimited."},"enabled":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the subaccount can access FTP.\n\n* `1` - Can access.\n* `0` - **Cannot** access."}}}}},"issues":{"type":"array","items":{"properties":{"area":{"example":"quota","description":"The affected section of cPanel & WHM.","type":"string"},"limit":{"example":"1500","description":"The set quota megabyte (MB) limit for the affected subaccount.","type":"integer"},"type":{"type":"string","enum":["error","warning","info"],"example":"info","description":"The type of issue.\n* `error`\n* `warning`\n* `info`"},"service":{"type":"string","example":"email","enum":["email","ftp","webdisk"],"description":"The affected service.\n* `email`\n* `ftp`\n* `webdisk`"},"used":{"description":"The number of megabytes (MB) that the account currently uses.","example":"2000","type":"integer"},"message":{"description":"The description of the issue.","example":"Your account is over quota.","type":"string"}},"type":"object"},"description":"Information about any issues or problems with the subaccount."},"real_name":{"type":"string","example":"John Doe","description":"The name of the subaccount's user.\n\n* A first name, a last name, or a first name and last name.\n* An empty string."},"has_siblings":{"type":"integer","description":"Whether the service account shares a `full_username` value with another service account.\n\n* `1` - Shares.\n* `0` - Does **not** share.","enum":["0","1"],"example":"0"},"domain":{"type":"string","example":"example.com","description":"The Subaccount user's associated domain.\n\nA domain that the cPanel account owns.","format":"domain"},"avatar_url":{"example":"https://img.example.com/avatars/example.jpg","format":"url","description":"The user's subaccount profile photo.","type":"string"},"dismissed":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the cPanel account user dismissed the merge prompt for the service account.\n\n**Note:**\n\n  **Only** service accounts return this value.\n\n* `1` - Dismissed.\n* `0` - Did **not** dismiss."},"alternate_email":{"example":"user@example.com","description":"An alternate email address for the subaccount's user.","format":"email","type":"string"},"synced_password":{"enum":["0","1"],"example":"0","description":"Whether the user has synchronized the passwords for each of the subaccount's service accounts.\n\n* `1` - Synchronized.\n* `0` - **Not** synchronized.\n\n**Note:**\n\n  The function returns a `null` value if the account is **not** a subaccount.","type":"integer"},"can_delete":{"type":"integer","description":"Whether the cPanel account user can delete the subaccount.\n\n* `1` - Can delete.\n* `0` - **Cannot** delete.","enum":["0","1"],"example":"0"},"guid":{"description":"The subaccount unique identifier.","example":"N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4","type":"string"},"username":{"type":"string","example":"example","description":"The username for the subaccount.\n\n* Length - 64 characters.\n* Characters - `a-z`, `A-Z`, `0-9`, dot (`.`), hyphen (`-`), underscore (`_`).\n\n**Note:**\n\n  This value does **not** include the domain name."},"can_set_quota":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the cPanel account user can change the subaccount's disk usage quota.\n\n* `1` - Can change.\n* `0` - **Cannot** change."},"special":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the account is a system-created special account that the user **cannot** remove.\n\n* `1` - A special account.\n* `0` - **Not** a special account."},"has_invite":{"type":"integer","description":"Whether an account login invitation exists.\n\n* `1` - Account invitation exists.\n* `0` - Account invitation does **not** exist.","enum":["0","1"],"example":"0"},"has_expired_invite":{"type":"integer","description":"Whether an expired account login invitation exists.\n\n* `1` - Expired account invitation exists.\n* `0` - Expired account invitation does **not** exist.","example":"0","enum":["0","1"]},"sub_account_exists":{"example":"0","enum":["0","1"],"description":"Whether a subaccount exists with the same username.\n\n* `1` - Exists.\n* `0` - Does **not** exist.\n\n**Note:**\n\n  The function returns a `null` value if the account is **not** a service account.","type":"integer"},"full_username":{"example":"user@example.com","description":"The subaccount's username and domain name.","type":"string"},"parent_type":{"type":"string","example":"hypothetical","description":"The type of account that could own the service account.\n\n* `sub` - A subaccount.\n* `hypothetical` - A hypothetical subaccount that does **not** yet exist, but the user could create as part of a merge.\n* `null`- **Not** a merge candidate."}},"type":"object"},"LookupServiceAccountSubaccountMergeCandidatesEmpty":{"type":"object","properties":{"merge_candidates":{"type":"array","items":{"type":"object"},"description":"An array of objects that represents the service accounts that the system could merge for this subaccount."}}}},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/UserManager/lookup_service_account":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  UserManager \\\n  lookup_service_account \\\n  type='email' \\\n  full_username='username@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserManager/lookup_service_account?type=email&full_username=username%40example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file UserManager_lookup_service_account.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/UserManager_lookup_service_account.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/UserManager/,\n    q/lookup_service_account/,\n    {\n        'type' => 'email',\n        'full_username' => 'username@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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file UserManager_lookup_service_account.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/UserManager_lookup_service_account.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    'UserManager',\n    'lookup_service_account',\n    array (\n        'type' => 'email',\n        'full_username' => 'username@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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["UserManager","Subaccount Management"],"summary":"Return service account's information","x-cpanel-api-version":"UAPI","parameters":[{"description":"The type of system account.\n* `email`\n* `ftp`\n* `webdisk`","schema":{"type":"string","enum":["email","ftp","webdisk"],"example":"email"},"name":"type","in":"query","required":"true"},{"required":"true","name":"full_username","in":"query","schema":{"example":"username@example.com","type":"string"},"description":"The full username for the system account."}],"operationId":"lookup_service_account","description":"This function lists a service account's information.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"properties":{"dismissed_merge_candidates":{"description":"An array of objects of service candidates that the system dismissed from merges.","items":{"$ref":"#/components/schemas/LookupServiceAccountSubaccountMergeCandidates"},"type":"array"}},"type":"object","allOf":[{"$ref":"#/components/schemas/LookupServiceAccountSubaccountBase"},{"$ref":"#/components/schemas/LookupServiceAccountSubaccountMergeCandidates"}]},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"UserManager","type":"string"},"func":{"example":"lookup_service_account","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54"}}},"x-tagGroups":[{"name":"cPanel Account","tags":["Subaccount Management"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"UserManager","description":"The UserManager module for UAPI."},{"name":"Subaccount Management","description":"cPanel Account / Subaccount Management"}]}},"Pushbullet":{"send_test_message":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"Pushbullet","description":"The Pushbullet module for UAPI."}],"paths":{"/Pushbullet/send_test_message":{"get":{"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"send_test_message","description":"The name of the method called."},"result":{"properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"status":{"example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"properties":{"payload":{"type":"object","description":"The payload from the Pushbullet server. For more information, read\n[Pushbullet's API documentation](https://docs.pushbullet.com/).\n\n**Warning:**\n\nThis return may contain values that are Boolean primitives. JSON\nproperly represents these, but XML represents them as `0` or `1`.","example":{"sender_email":"user@example.com","modified":"1431976341.39182","direction":"self","iden":"ujw5ScArtjUsjAeRXXMLGS","sender_email_normalized":"user@example.com","sender_name":"Firstname Lastname","created":"1431976341.38872","receiver_iden":"ujw5ScArtjU","body":"This message confirms that “hostname.example.com“ (192.168.0.20)\ncan send a message to you via Pushbullet.\n\nThis message was sent on Monday, May 18, 2015 at 7:12:20 PM UTC.","active":"true","receiver_email":"user@example.com","type":"note","title":"Test message (ID: 555a3994-173a4a271062d)","sender_iden":"ujw5ScArtjU","dismissed":"false","receiver_email_normalized":"user@example.com"}},"message_id":{"type":"string","example":"554d2cbd-efe61da3cacb","description":"The test message's ID."}}},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","example":"Pushbullet","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"send_test_message","description":"This function sends a Pushbullet™ test message to determine that the token is valid and that the account holder can receive the message.","parameters":[{"description":"The Pushbullet access token.\n\n**Note:**\n\n* Your Pushbullet token is available on\n[Pushbullet's My Account](https://www.pushbullet.com/account) page under\nthe *Access Token* heading.\n* This is confidential information that your server sends via a secure channel.","schema":{"example":"a1b2c3d4e5f6g7h8i9j0","type":"string"},"in":"query","name":"access_token","required":"true"}],"summary":"Validate Pushbullet token","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Pushbullet \\\n  send_test_message \\\n  access_token='a1b2c3d4e5f6g7h8i9j0'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Pushbullet/send_test_message?access_token=a1b2c3d4e5f6g7h8i9j0","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Pushbullet_send_test_message.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Pushbullet_send_test_message.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/Pushbullet/,\n    q/send_test_message/,\n    {\n        'access_token' => 'a1b2c3d4e5f6g7h8i9j0',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Pushbullet_send_test_message.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Pushbullet_send_test_message.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    'Pushbullet',\n    'send_test_message',\n    array (\n        'access_token' => 'a1b2c3d4e5f6g7h8i9j0',\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}"}],"tags":["Pushbullet"]}}},"x-tagGroups":[{"name":"Notifications","tags":["Pushbullet"]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}}},"DNS":{"has_local_authority":{"paths":{"/DNS/has_local_authority":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return whether local DNS server is authoritative","tags":["DNS","DNS Information"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNS \\\n  has_local_authority \\\n  domain='example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/has_local_authority?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_has_local_authority.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_has_local_authority.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/DNS/,\n    q/has_local_authority/,\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    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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_has_local_authority.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_has_local_authority.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    'DNS',\n    'has_local_authority',\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    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}","label":"LiveAPI PHP","lang":"PHP"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"DNS"},"result":{"properties":{"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"data":{"example":[{"domain":"example.com","nameservers":["ns1.example.com","ns2.example.com"],"zone":"example.com","local_authority":"1"},{"nameservers":[],"local_authority":"0","domain":"example2.com"},{"nameservers":[],"zone":"example3.com","local_authority":"0","domain":"example3.com","error":"(XID 3z756a) DNS query (example3.com/SOA) timeout!"}],"description":"An array of objects containing information about the authoritative status of a domain's local DNS zone files.","items":{"type":"object","properties":{"domain":{"type":"string","format":"domain","description":"The queried domain."},"error":{"type":"string","description":"An error message that details the reason why the local server's\nauthoritative check failed.\n\n**Note:**\n\nThe function **only** returns this value when the check fails."},"nameservers":{"items":{"format":"domain","type":"string"},"description":"The domain's nameservers, if any exist.","type":"array"},"local_authority":{"description":"Whether the local server is authoritative for the domain's DNS\nrecords.\n\n* `1` — The local server is authoritative for the domain's DNS\nrecords.\n* `0` — The local server is **not** authoritative for the domain's\nDNS records.","enum":["1","0"],"type":"integer"},"zone":{"nullable":"true","description":"The domain's DNS zone, if one exists.\n\n* `null` — No valid DNS zone.","format":"domain","type":"string"}}},"type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"nullable":"true","type":"string"},"example":null,"type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"example":"has_local_authority","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 78","parameters":[{"required":"true","name":"domain","in":"query","schema":{"format":"domain","example":"example.com","type":"string"},"description":"The domain to check whether the local server is authoritative for the domain's\nDNS records.\n\n**Note:**\n\nTo check multiple domains, increment or duplicate the parameter name. For\nexample, `domain-0`, `domain-1`, and `domain-2`.","examples":{"multiple":{"summary":"Check multiple domains.","value":"domain-0=example.com domain-1=example1.com domain-2=example2.com"},"multiple-alternative":{"summary":"Check multiple domains.","value":"domain=example.com domain=example1.com domain=example2.com"},"single":{"value":"example.com","summary":"Check a single domain."}}}],"operationId":"has_local_authority","description":"This function checks whether the local server is authoritative for the domain's DNS records."}}},"x-tagGroups":[{"tags":["DNS Information"],"name":"DNS"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"DNS","description":"The DNS module for UAPI."},{"description":"DNS / DNS Information","name":"DNS Information"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"swap_ip_in_zones":{"paths":{"/DNS/swap_ip_in_zones":{"get":{"parameters":[{"examples":{"multiple-alternative":{"value":"example.com domain=example1.com domain=example2.com","summary":"Update multiple domains."},"multiple":{"value":"example.com domain-1=example1.com domain-2=example2.com","summary":"Update multiple domains."},"single":{"value":"example.com","summary":"Update a single domain."}},"description":"The domain to perform the zone file updates on.\n\n**Note:**\n\nTo update multiple domains, increment or duplicate the parameter name. For\nexample, `domain-0`, `domain-1`, and `domain-2`.","schema":{"format":"domain","example":"example.com","type":"string"},"name":"domain","in":"query","required":"true"},{"schema":{"type":"string","example":"192.0.2.0","format":"ipv4"},"description":"The IPv4 address to replace in the zone files. The detected source IPv4 address is one of:\n\n* If there is an A record for the root of the zone **and** the IP address is **not** a loopback address, then the system will use its address.\n* If there are any A records in the zone whose addresses are **not** loopback addresses, then the system will use the address of the first such A record in the zone file.\n* If no A records exist in the zone **or** all A records have loopback addresses, then the system will **not** update the zone file.\n\nIf you do **not** call this parameter, the system will automatically detect the IP addresses in the zone files.","required":"false","name":"source_ip","in":"query"},{"required":"true","in":"query","name":"dest_ip","schema":{"format":"ipv4","example":"192.0.2.1","type":"string"},"description":"The IPv4 address to use as the replacement in the zone files."},{"schema":{"type":"string","format":"ipv4","example":"192.0.2.1"},"description":"The IPv4 address to use as the replacement for FTP records in the zone files.\n\nIf this parameter is **not** provided, then the system will use the `dest_ip` value.","required":"false","name":"ftp_ip","in":"query"}],"description":"This function replaces a domain's IPv4 address in the DNS zone\nfile with the specified destination IPv4 address.","operationId":"DNS-swap_ip_in_zones","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"swap_ip_in_zones","description":"The name of the method called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"data":{"items":{"properties":{"record_type":{"example":"A","description":"The type of the DNS record which was updated.","type":"string"},"record_name":{"type":"string","example":"example.com","format":"domain","description":"The name of the domain's updated DNS record.","nullable":"false"},"zone_name":{"type":"string","nullable":"false","example":"example.com","description":"The DNS zone in which the system updated the domain's record.","format":"domain"},"old_value":{"example":"192.0.2.0","description":"The value of the DNS record before it was updated.","type":"string"},"new_value":{"description":"The value of the DNS record after it was updated.","example":"192.0.2.1","type":"string"}}},"description":"An array of objects containing the updated DNS records, including their previous values."},"metadata":{"properties":{}}},"type":"object"},"module":{"example":"DNS","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 96","tags":["DNS"],"x-codeSamples":[{"source":"uapi --user=username DNS swap_ip_in_zones domain='example.com' source_ip='192.0.2.0' dest_ip='192.0.2.1'","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/swap_ip_in_zones?domain=example.com&source_ip=192.0.2.0&dest_ip=192.0.2.1"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_swap_ip_in_zones.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_swap_ip_in_zones.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/DNS/,\n    q/swap_ip_in_zones/,\n    {\n        'domain'    => 'example.com',\n        'source_ip' => '192.0.2.0',\n        'dest_ip'   => '192.0.2.1',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_swap_ip_in_zones.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_swap_ip_in_zones.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    'DNS',\n    'swap_ip_in_zones',\n    array (\n        'domain'    => 'example.com',\n        'source_ip' => '192.0.2.0',\n        'dest_ip'   => '192.0.2.1',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Update IP addresses in zone files"}}},"x-tagGroups":[{"tags":["DNS"],"name":"DNS"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The DNS module for UAPI.","name":"DNS"}],"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"is_alias_available":{"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"cPanel L.L.C."},"version":"11.121.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"paths":{"/DNS/is_alias_available":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return `ALIAS` DNS record availability & resolver","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"DNS","type":"string"},"result":{"properties":{"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"example":"1","enum":["0","1"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"data":{"properties":{"resolver":{"type":"string","description":"The value (if any) of the running PDNS’s `resolver` setting.","example":"8.8.8.8"},"alias":{"description":"Whether `ALIAS` records are available.\n\n* `1` - Available.\n* `0` - Not available.\n\nWhen `ALIAS` records are enabled, they may work in API calls that accept `A` and `AAAA` records. However, the `ALIAS` record must use a fully qualified domain name (FQDN) rather than an IP address.","example":"1","enum":["1","0"],"type":"integer"},"aname":{"type":"integer","example":"0","enum":["1","0"],"description":"Whether `ANAME` records are available.\n\n* `1` - Available.\n* `0` - Not available.\n\n**NOTE:**\n\nThe `aname` value is always set to false (i.e. Not available). The `ANAME` record is currently not supported. It is included for completeness and future proofing."}},"type":"object"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","example":"is_alias_available","description":"The name of the method called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 122","tags":["DNS","DNS Information"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty --user=username DNS is_alias_available\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/is_alias_available","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_is_alias_available.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_is_alias_available.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(DNS => 'is_alias_available');\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_is_alias_available.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_is_alias_available.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    'DNS',\n    'is_alias_available'\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}"}],"description":"This function returns whether `ALIAS` and `ANAME` records are available and the value of the running PowerDNS (PDNS) `resolver` setting, if any exists.\nFor more information, read our [`ALIAS` documentation](https://go.cpanel.net/dns-alias-record).","operationId":"DNS::is_alias_available"}}},"x-tagGroups":[{"name":"DNS","tags":["DNS Information"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The DNS module for UAPI.","name":"DNS"},{"description":"DNS / DNS Information","name":"DNS Information"}]},"parse_zone":{"tags":[{"name":"DNS","description":"The DNS module for UAPI."},{"description":"DNS / DNS Information","name":"DNS Information"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["DNS Information"],"name":"DNS"}],"paths":{"/DNS/parse_zone":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return a parsed DNS zone","tags":["DNS","DNS Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNS \\\n  parse_zone \\\n  zone='example.com'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/parse_zone?zone=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_parse_zone.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_parse_zone.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/DNS/,\n    q/parse_zone/,\n    {\n        'zone' => '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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_parse_zone.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_parse_zone.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    'DNS',\n    'parse_zone',\n    array (\n        'zone' => '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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"parse_zone","type":"string"},"module":{"example":"DNS","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"data":{"$ref":"#/components/schemas/Payload"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}}}}}},"x-cpanel-available-version":"96","parameters":[{"name":"zone","in":"query","required":"true","description":"The name of one of the user’s DNS zones.","schema":{"example":"example.com","type":"string"}}],"operationId":"dns-parse_zone","description":"This function parses a given DNS zone.\n\n**Important:**\n\nMost DNS zones contain only 7-bit ASCII. However, it is possible for\nDNS zones to contain any binary sequence. An application that decodes\nthis function's base64 output **must** be able to handle cases\nwhere the decoded octets do not match any specific character\nencoding."}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{"ResponseControlOrComment":{"allOf":[{"$ref":"#/components/schemas/ResponseBase"},{"type":"object","properties":{"text_b64":{"format":"base64","description":"The line’s text, encoded to base64.","example":"OyBab25lIGZpbGUgZm9yIHRleGFzLmNvbQ==","type":"string"}}}]},"ResponseRR":{"allOf":[{"$ref":"#/components/schemas/ResponseBase"},{"properties":{"record_type":{"type":"string","example":"MX","description":"The resource record’s type."},"data_b64":{"items":{"type":"string","example":"dGV4YXMuY29tLg==","format":"base64"},"description":"The resource record’s content, encoded to base64.","type":"array"},"ttl":{"example":"14400","description":"The resource record’s TTL (Time-to-Live).","minimum":"0","type":"integer"},"dname_b64":{"type":"string","example":"dGV4YXMuY29tLg==","description":"The resource record’s owner, encoded to base64. A base64-decoded owner that lacks a trailing period (`.`) is a subdomain of the zone.","format":"base64"}},"type":"object"}],"title":"Resource Record"},"ResponseControl":{"title":"Control","allOf":[{"$ref":"#/components/schemas/ResponseControlOrComment"}]},"ResponseComment":{"title":"Comment","allOf":[{"$ref":"#/components/schemas/ResponseControlOrComment"}]},"ResponseBase":{"properties":{"line_index":{"description":"The line’s index in the zone file.","example":"22","type":"integer","minimum":"0"},"type":{"type":"string","description":"The type of object in the zone file:\n\n* `record` - A resource record.\n* `control` - A control statement.\n* `comment` - A line comment.","enum":["record","control","comment"]}},"type":"object"},"Payload":{"description":"The zone’s content.","items":{"discriminator":{"propertyName":"type","mapping":{"comment":"#/components/schemas/ResponseComment","record":"#/components/schemas/ResponseRR","control":"#/components/schemas/ResponseControl"}},"oneOf":[{"$ref":"#/components/schemas/ResponseRR"},{"$ref":"#/components/schemas/ResponseControl"},{"$ref":"#/components/schemas/ResponseComment"}]},"type":"array"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"is_https_available":{"paths":{"/DNS/is_https_available":{"get":{"x-cpanel-available-version":"cPanel 122","x-cpanel-api-version":"UAPI","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"data":{"type":"object","properties":{"dns_server":{"type":"string","description":"The DNS server type currently in use (bind, pdns, etc.).","example":"pdns"},"https":{"type":"integer","description":"Whether HTTPS records are supported.\n* `1` - Supported.\n* `0` - Not supported.","enum":["1","0"],"example":"1"}}},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","example":"DNS","description":"The name of the module called."},"func":{"description":"The name of the method called.","example":"is_https_available","type":"string"}}}}}}},"summary":"Return DNS HTTPS record support information","operationId":"is_https_available","description":"This function fetches information regarding HTTPS records support.\nHTTPS records are defined in RFC 9460 and provide service parameters for HTTPS endpoints.\nFor more information, read our [HTTPS record documentation](https://go.cpanel.net/dns-https-record).","tags":["DNS","DNS Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty --user=username DNS is_https_available\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/is_https_available"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_is_https_available.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_is_https_available.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(DNS => 'is_https_available');\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_is_https_available.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_is_https_available.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    'DNS',\n    'is_https_available'\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"x-tagGroups":[{"name":"DNS","tags":["DNS Information"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"DNS","description":"The DNS module for UAPI."},{"name":"DNS Information","description":"DNS / DNS Information"}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.121.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"cPanel L.L.C."}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"fetch_cpanel_generated_domains":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.136.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"name":"DNS","description":"The DNS module for UAPI."},{"name":"DNS Information","description":"DNS / DNS Information"}],"paths":{"/DNS/fetch_cpanel_generated_domains":{"get":{"x-cpanel-api-version":"UAPI","summary":"Retrieve cPanel-generated subdomains for a domain","tags":["DNS","DNS Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNS \\\n  fetch_cpanel_generated_domains \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/fetch_cpanel_generated_domains?domain=example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_fetch_cpanel_generated_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_fetch_cpanel_generated_domains.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/DNS/,\n    q/fetch_cpanel_generated_domains/,\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    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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_fetch_cpanel_generated_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_fetch_cpanel_generated_domains.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    'DNS',\n    'fetch_cpanel_generated_domains',\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    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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 120","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"fetch_cpanel_generated_domains","description":"The name of the method called."},"module":{"type":"string","example":"DNS","description":"The name of the module called."},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"],"type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"type":"array","example":[{"domain":"example.com."},{"domain":"cpanel.example.com."},{"domain":"mail.example.com."},{"domain":"webmail.example.com."},{"domain":"webdisk.example.com."}],"description":"An array of objects containing the cPanel-generated domain names for the specified domain.","items":{"properties":{"domain":{"type":"string","example":"webmail.example.com.","description":"A cPanel-generated domain name, returned as a fully-qualified\ndomain name (FQDN) with a trailing dot.","format":"domain"}},"type":"object"}},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}}}},"operationId":"DNS-fetch_cpanel_generated_domains","description":"This function retrieves the list of subdomains that cPanel automatically\ngenerates for a given domain. These include proxy subdomains such as\n`webmail`, `mail`, and `cpanel`, as well as other system-generated\ndomain names.","parameters":[{"in":"query","name":"domain","required":"true","examples":{"single":{"value":"example.com","summary":"Retrieve generated subdomains for a domain."}},"description":"The domain for which to retrieve cPanel-generated subdomains.","schema":{"type":"string","example":"example.com","format":"domain"}}]}}},"x-tagGroups":[{"name":"DNS","tags":["DNS Information"]}]},"mass_edit_zone":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"x-tagGroups":[{"name":"DNS","tags":["DNS Information"]}],"paths":{"/DNS/mass_edit_zone":{"get":{"tags":["DNS","DNS Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty --user=username DNS mass_edit_zone zone='example.com' serial='202001010100' remove=23 add='{\"dname\":\"example\",\"ttl\":14400,\"record_type\":\"A\",\"data\":[\"127.0.0.1\"]}'","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/mass_edit_zone?zone=example.com&serial=202001010100&remove=23"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_mass_edit_zone.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_mass_edit_zone.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/DNS/,\n    q/mass_edit_zone/,\n    {\n        'zone' => 'example.com',\n        'serial' => '202001010100',\n        'add' => '{\"dname\":\"example\",\"ttl\":14400,\"record_type\":\"A\",\"data\":[\"127.0.0.1\"]}',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_mass_edit_zone.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_mass_edit_zone.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    'DNS',\n    'mass_edit_zone',\n    array (\n        'zone' => 'example.com',\n        'serial' => '202001010100',\n        'add' => '{\"dname\":\"example\",\"ttl\":14400,\"record_type\":\"A\",\"data\":[\"127.0.0.1\"]}',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Update a DNS zone","description":"This function updates a DNS zone by allowing multiple records to be added, modified, or removed in a single call. It also ensures modified records occupy the same number of lines as before the edit.\n\n**NOTE:**\n\nYou cannot use this function to edit temporary domains.","operationId":"dns-mass_edit_zone","parameters":[{"name":"zone","in":"query","required":"true","description":"The name of one of the user’s DNS zones.","schema":{"type":"string","example":"example.com"}},{"schema":{"type":"integer","minimum":"0","example":"202001010100"},"description":"The current serial number in the DNS zone’s SOA (Start of Authority)\nrecord. If this value does not match the zone’s current state, the\nrequest fails.","required":"true","in":"query","name":"serial"},{"required":"false","name":"add","in":"query","schema":{"items":{"format":"json","type":"string"},"type":"array"},"explode":"true","examples":{"aaaa":{"description":"A TXT record.","value":"'{\"dname\":\"example\", \"ttl\":14400, \"record_type\":\"TXT\", \"data\":[\"string1\", \"string2\"]}'"},"a":{"description":"An A record.","value":"'{\"dname\":\"example\", \"ttl\":14400, \"record_type\":\"A\", \"data\":[\"11.22.33.44\"]}'"}},"description":"The records to add to the zone. Each item must be a serialized\nJSON object that contains:\n\n* `dname` — The record’s name.\n* `ttl` — The record’s TTL (Time-To-Live) value.\n* `record_type` — The record’s type. For example, `A` or `TXT`.\n* `data` — An array of strings. The format and number of the\n  strings depend on the `record_type` value."},{"schema":{"type":"array","items":{"format":"json","example":"'{\"line_index\": 9, \"dname\":\"example\", \"ttl\":14400, \"record_type\":\"TXT\", \"data\":[\"string1\", \"string2\"]}'","type":"string"}},"explode":"true","description":"The records to edit in the zone. Each item must be a serialized\nJSON object that contains:\n\n* `line_index` — The line number in the DNS zone where the record starts.\n  This is a 0-based index, so to edit the first line in the file\n  use the `0` value. To edit the second line, give `1`, and so forth.\n* `dname` — The record’s name.\n* `ttl` — The record’s TTL (Time-To-Live) value.\n* `record_type` — The record’s new type. For example, `A` or `TXT`.\n* `data` — An array of strings. The format and number of the\n  strings depend on the `record_type` value.","required":"false","in":"query","name":"edit"},{"description":"The line indexes of records to remove from the zone.","schema":{"type":"array","items":{"example":"22","minimum":"0","type":"integer"}},"explode":"true","in":"query","name":"remove","required":"false"}],"x-cpanel-available-version":"96","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"mass_edit_zone"},"module":{"type":"string","example":"DNS","description":"The name of the module called."},"result":{"type":"object","properties":{"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"data":{"properties":{"new_serial":{"example":"2021031903","description":"The DNS zone’s SOA record’s new serial number.\nYou can use this to submit later edits if you\ntrack the number of lines each record takes up.","type":"integer","minimum":"0"}}},"status":{"enum":["0","1"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}}}}}}},"tags":[{"description":"The DNS module for UAPI.","name":"DNS"},{"name":"DNS Information","description":"DNS / DNS Information"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"lookup":{"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/DNS/lookup":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"DNS","description":"The name of the module called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"data":{"type":"array","items":{"type":"string"},"description":"Contains each response item.","example":["example.com has address 93.184.216.34","example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946","example.com mail is handled by 0 ."],"nullable":"true"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}}},"type":"object"},"func":{"type":"string","description":"The name of the method called.","example":"lookup"}},"type":"object"}}}}},"x-cpanel-available-version":"90","parameters":[{"description":"A fully qualified domain name.","schema":{"type":"string","example":"example.com"},"in":"query","name":"domain","required":"true"}],"description":"This function returns DNS zone information about a domain.","operationId":"dns-lookup","x-cpanel-api-version":"UAPI","summary":"Return domain's DNS information","tags":["DNS","DNS Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNS \\\n  lookup \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/lookup?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_lookup.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_lookup.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/DNS/,\n    q/lookup/,\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    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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_lookup.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_lookup.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    'DNS',\n    'lookup',\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    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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"tags":["DNS Information"],"name":"DNS"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"DNS","description":"The DNS module for UAPI."},{"name":"DNS Information","description":"DNS / DNS Information"}]},"ensure_domains_reside_only_locally":{"x-tagGroups":[{"name":"DNS","tags":["DNS Information"]}],"paths":{"/DNS/ensure_domains_reside_only_locally":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"ensure_domains_reside_only_locally","description":"The name of the method called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"type":"array","nullable":"true","items":{"type":"string","example":"The domain resolves to Mars. Beep beep beep."},"description":"The results from each domain parameter's DNS query.\n* `null` - The domain **only** resolves locally to the server.\n* A valid string that explains to where the domain resolves.\n\n**Note:**\n\n The function returns the results from the domains in the same order that you called them."},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}}}},"module":{"type":"string","description":"The name of the module called.","example":"DNS"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 56","parameters":[{"name":"domain","in":"query","required":"true","description":"The domain to check.\n\n**Note:**\n\nTo check multiple domains, duplicate or increment the parameter name. For example, to exclude three domains, you could:\n* Use the `domain` parameter multiple times.\n* Use the `domain`, `domain-1`, and `domain-2` parameters.","examples":{"multiple":{"value":"domain=example.com&domain-1=example1.com&domain-2=example2.com","summary":"Multiple domains"},"multiple-alternative":{"value":"domain=example.com&domain=example1.com&domain=example2.com","summary":"Multiple domains"},"single":{"summary":"A single domain.","value":"example.com"}},"schema":{"type":"string","format":"domain","example":"example1.com"}}],"description":"This function indicates whether the account's domains resolve exclusively to this server.","operationId":"ensure_domains_reside_only_locally","x-cpanel-api-version":"UAPI","summary":"Return whether domains only resolve locally","tags":["DNS","DNS Information"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DNS \\\n  ensure_domains_reside_only_locally \\\n  domain='example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DNS/ensure_domains_reside_only_locally?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DNS_ensure_domains_reside_only_locally.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DNS_ensure_domains_reside_only_locally.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/DNS/,\n    q/ensure_domains_reside_only_locally/,\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    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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DNS_ensure_domains_reside_only_locally.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DNS_ensure_domains_reside_only_locally.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    'DNS',\n    'ensure_domains_reside_only_locally',\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    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}"}]}}},"tags":[{"description":"The DNS module for UAPI.","name":"DNS"},{"name":"DNS Information","description":"DNS / DNS Information"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2"}},"DomainInfo":{"main_domain_builtin_subdomain_aliases":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"tags":["Domain Information"],"name":"Domain Management"}],"paths":{"/DomainInfo/main_domain_builtin_subdomain_aliases":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"main_domain_builtin_subdomain_aliases"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"type":"array","example":["mail","www"],"items":{"type":"string"},"description":"A list of the built-in subdomain aliases for the account's main domain."},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}},"type":"object"},"module":{"type":"string","example":"DomainInfo","description":"The name of the module called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"schema":{"example":"1","enum":["1","0"],"default":"0","type":"integer"},"description":"Whether to hide domain aliases if the main domain is a temporary domain.\n\n* `1` — Return empty array if the main domain is a temporary domain.\n* `0` — Show aliases regardless of domain type.","required":"false","in":"query","name":"hide_temporary_domains"}],"operationId":"main_domain_builtin_subdomain_aliases","description":"This function returns the built-in subdomain aliases for an account's main domain.\n\n**Note:**\n\n  This function retrieves data from the `/var/cpanel/userdata/user/domain` file, where `user` represents the cPanel account username and `domain` represents the domain. For this reason, actual output may not contain all of the returns that this document lists.","x-cpanel-api-version":"UAPI","summary":"Return built-in subdomain aliases","tags":["DomainInfo","Domain Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DomainInfo \\\n  main_domain_builtin_subdomain_aliases\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DomainInfo/main_domain_builtin_subdomain_aliases","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DomainInfo_main_domain_builtin_subdomain_aliases.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DomainInfo_main_domain_builtin_subdomain_aliases.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/DomainInfo/,\n    q/main_domain_builtin_subdomain_aliases/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DomainInfo_main_domain_builtin_subdomain_aliases.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DomainInfo_main_domain_builtin_subdomain_aliases.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    'DomainInfo',\n    'main_domain_builtin_subdomain_aliases'\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"tags":[{"name":"DomainInfo","description":"The DomainInfo module for UAPI."},{"description":"Domain Management / Domain Information","name":"Domain Information"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"list_domains":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The DomainInfo module for UAPI.","name":"DomainInfo"},{"description":"Domain Management / Domain Information","name":"Domain Information"}],"paths":{"/DomainInfo/list_domains":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return cPanel account's domains","tags":["DomainInfo","Domain Information"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DomainInfo \\\n  list_domains\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DomainInfo/list_domains"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DomainInfo_list_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DomainInfo_list_domains.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/DomainInfo/,\n    q/list_domains/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DomainInfo_list_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DomainInfo_list_domains.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    'DomainInfo',\n    'list_domains'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"list_domains"},"module":{"type":"string","example":"DomainInfo","description":"The name of the module called."},"result":{"type":"object","properties":{"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"properties":{"main_domain":{"type":"string","example":"example.com","format":"domain","description":"The cPanel account's main domain.","nullable":"true"},"parked_domains":{"description":"An array of string values that lists the parked domains on the cPanel account.","items":{"type":"string","format":"domain","example":"parkeddomain.com"},"type":"array"},"is_temporary":{"type":"object","additionalProperties":{"type":"integer","description":"* `1` — The domain is temporary.\n* `0` — The domain is not temporary.","enum":["0","1"]},"description":"Whether the domain is a temporary domain."},"addon_domains":{"type":"array","description":"An array of string values that lists the addon domains on the cPanel account.","items":{"type":"string","example":"addondomain.com","format":"domain"}},"sub_domains":{"items":{"type":"string","example":"subdomain.example.com","format":"domain"},"description":"An array of string values that lists the subdomains on the cPanel account.","type":"array"}},"type":"object"},"metadata":{"properties":{}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"required":"false","name":"hide_temporary_domains","in":"query","schema":{"enum":["1","0"],"example":"1","default":"0","type":"integer"},"description":"Whether to hide temporary domains from the response arrays.\n\n* `1` — Hide temporary domains from the `addon_domains`, `sub_domains`, and `parked_domains` arrays, and from the `main_domain` field.\n* `0` — Return all domains, including the temporary domains."}],"operationId":"list_domains","description":"This function lists the cPanel account's domains.\n\n**Note:**\n\nFor this function to succeed, the `/var/cpanel/userdata/username/main` file (where `username` represents the authenticated user) **must** possess the correct permissions. If a permissions error occurs, this function returns blank values for **all** of its returns and does **not** return an error message."}}},"x-tagGroups":[{"tags":["Domain Information"],"name":"Domain Management"}]},"single_domain_data":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"description":"The DomainInfo module for UAPI.","name":"DomainInfo"},{"name":"Domain Information","description":"Domain Management / Domain Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"name":"Domain Management","tags":["Domain Information"]}],"paths":{"/DomainInfo/single_domain_data":{"get":{"operationId":"single_domain_data","description":"This function lists user data for a domain.\n\n**Important:**\n\n  This function retrieves data from the `/var/cpanel/userdata/user/domain` file, where `user` represents the cPanel account username and `domain` represents the domain.\n  * Because aliases (parked domains) do **not** use a user data file, this function **cannot** query information for aliases. To retrieve information for an alias, specify the associated main or addon domain.\n  * Due to differences in user data files, the function's actual output may not contain all of the returns that this document lists.","parameters":[{"in":"query","name":"domain","required":"true","description":"The domain on the cPanel account.\n\n**Important:**\n\nDo **not** specify an alias (parked domain).","schema":{"type":"string","format":"domain","example":"example.com"}},{"name":"return_https_redirect_status","in":"query","required":"false","description":"Whether to return the secure redirect status of the addon domains.\n* `1` - Return status.\n* `0` - Do **not** return status.","schema":{"type":"integer","enum":["0","1"],"example":"1","default":"0"}},{"schema":{"type":"integer","default":"0","enum":["1","0"],"example":"1"},"description":"Whether to hide temporary domains from the returned values.\n\n* `1` — Return an error if the requested domain is a temporary domain.\n* `0` — Return all domains, including the temporary domains.\n\n**Note:**\n\nIf you set this parameter's value to `1` and the requested domain is temporary,\nthe function will return an error similar to the following example: `Domain [example.com] is a temporary\ndomain and `hide_temporary_domains` is enabled.`","required":"false","name":"hide_temporary_domains","in":"query"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"properties":{"options":{"description":"The Apache `Options` directive for the domain.","example":"ExecCGI Includes","type":"string"},"is_https_redirecting":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the domain redirects to https.\n* `1` - Redirects.\n* `0` - Does **not** redirect.\n\n**Important:**\n\nThis return only appears if you set the `return_https_redirects_status` parameter to `1`."},"scriptalias":{"properties":{"path":{"example":"/home/user/public_html/cgi-bin","format":"path","description":"The absolute path to the domain's CGI directory.","type":"string"},"url":{"type":"string","format":"url-path","description":"The domain's CGI directory.","example":"/cgi-bin/"}},"type":"object","description":"An object containing CGI information."},"homedir":{"description":"The absolute path to the account's home directory.","format":"path","example":"/home/user","type":"string"},"owner":{"type":"string","example":"root","format":"username","description":"The WHM account (root or a reseller) that owns the cPanel account."},"ifmodulemodsuphpc":{"description":"An object containing information about PHP scripts and suPHP.","type":"object","properties":{"group":{"description":"If suPHP is enabled, the group that PHP scripts run as.","example":"user","type":"string"}}},"serveralias":{"type":"string","example":"parkeddomain.com www.parkeddomain.com www.example.com","description":"A space-separated list of the domain's aliases."},"all_aliases_valid":{"type":"integer","description":"Whether a valid SSL certificate exists on the domain's aliases.\n* `1` - A valid SSL certificate exists on the aliases.\n* `0` - A valid SSL certificate does **not** exist on the aliases.\n\n**Important:**\n\nThis return only appears if you set the `return_https_redirects_status` parameter to `1`.","enum":["0","1"],"example":"0"},"userdirprotect":{"type":"integer","description":"The domain's [Apache `mod_userdir` Tweak](https://go.cpanel.net/whmdocsApachemod_userdirTweak) setting.\n* `1` - Enabled.\n* `0` - Disabled.","enum":["0","1"],"example":"1"},"documentroot":{"description":"The absolute path to the domain's document root.","format":"path","example":"/home/user/public_html/","type":"string"},"can_https_redirect":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether a valid SSL certificate exists or AutoSSL runs on the domain.\n* `1` - A valid SSL certificate exists or AutoSSL runs.\n* `0` - A valid SSL certificate does **not** exist, and AutoSSL does not run.\n\n**Important:**\n\nThis return only appears if you set the `return_https_redirects_status` parameter to `1`."},"phpopenbasedirprotect":{"example":"1","enum":["0","1"],"description":"The domain's `open_basedir` setting.\n* `1` - Enabled.\n* `0` - Disabled.\n\n**Note:**\n\nIn EasyApache 4, change this directive in the *Editor Mode* section of WHM's\n[*MultiPHP INI Editor*](https://go.cpanel.net/whmdocsMultiPHPINIEditor) interface\n(*WHM >> Home >> Software >> MultiPHP INI Editor*).","type":"integer"},"servername":{"type":"string","example":"example.com","format":"domain","description":"The domain's identifier on the server."},"is_temporary":{"type":"integer","enum":["0","1"],"description":"Whether the domain is a temporary domain.\n* `1` — The domain is temporary.\n* `0` — The domain is not temporary."},"hascgi":{"type":"integer","description":"Whether CGI is enabled for the domain.\n* `1` - Enabled.\n* `0` - Disabled.","example":"1","enum":["0","1"]},"type":{"type":"string","description":"The domain type.\n* `addon_domain` - The domain is an addon domain.\n* `sub_domain` - The domain is a subdomain.\n* `main_domain` - The domain is the account's main domain.\n* `parked_domain` - The domain is a parked domain (domain alias).","example":"main_domain","enum":["addon_domain","sub_domain","main_domain","parked_domain"]},"group":{"example":"user","description":"The domain's group name.","type":"string"},"customlog":{"properties":{"domain":{"example":"combined","description":"The `target` log file's domain. An [Apache log](http://httpd.apache.org/docs/2.2/mod/mod_log_config.html) domain. Generally, this value is `combined`.","type":"string"},"target":{"format":"path","description":"The absolute path to the domain's log file.","example":"/usr/local/apache/domlogs/example.com","type":"string"}},"type":"object","description":"An object containing Apache log information."},"domain":{"example":"example.com","format":"domain","description":"The domain name on the cPanel account.","type":"string"},"serveradmin":{"example":"webmaster@example.com","description":"The domain's administrator's contact email address.","format":"email","type":"string"},"ip":{"type":"string","example":"192.168.0.128","description":"The domain's IP address.","format":"ipv4"},"port":{"example":"80","description":"Apache's port to access the domain.","minimum":"1","maximum":"65335","type":"integer"},"user":{"type":"string","description":"The cPanel account's username.","format":"username","example":"user"},"usecanonicalname":{"enum":["On","Off"],"example":"Off","description":"The domain's Canonical Name (CNAME) setting.\n* `On` - Use the CNAME.\n* `Off` - Do **not** use the CNAME.","type":"string"}},"type":"object"},"status":{"description":"- 1 - Success.\n- 0 - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"DomainInfo","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"single_domain_data"}}}}}}},"tags":["DomainInfo","Domain Information"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DomainInfo \\\n  single_domain_data \\\n  domain='example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DomainInfo/single_domain_data?domain=example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DomainInfo_single_domain_data.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DomainInfo_single_domain_data.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/DomainInfo/,\n    q/single_domain_data/,\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DomainInfo_single_domain_data.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DomainInfo_single_domain_data.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    'DomainInfo',\n    'single_domain_data',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return domain's hosting configuration"}}}},"domains_data":{"tags":[{"description":"The DomainInfo module for UAPI.","name":"DomainInfo"},{"name":"Domain Information","description":"Domain Management / Domain Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"name":"Domain Management","tags":["Domain Information"]}],"paths":{"/DomainInfo/domains_data":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"examples":{"list":{"value":{"data":[{"is_https_redirecting":"0","options":"ExecCGI Includes","ifmodulemodsuphpc":{"group":"user"},"owner":"root","scriptalias":[{"url":"/cgi-bin/","path":"/home/user/public_html/cgi-bin"},{"url":"/cgi-bin/","path":"/home/user/public_html/cgi-bin/"}],"homedir":"/home/user","userdirprotect":"1","serveralias":"parkeddomain.com www.parkeddomain.com www.example.com","all_aliases_valid":"0","servername":"example.com","hascgi":"1","is_temporary":"0","can_https_redirect":"0","documentroot":"/home/user/public_html","type":"main_domain","customlog":[{"target":"/usr/local/apache/domlogs/example.com","format":"combined"},{"target":"/usr/local/apache/domlogs/example.com-bytes_log","format":"\"%{%s}t %I .\\n%{%s}t %O .\""}],"group":"user","ip":"192.168.0.128","serveradmin":"webmaster@example.com","domain":"example.com","port":"80","usecanonicalname":"Off","user":"user"},{"parked_with_https_redirects":["parkeddomain.com"]},{"parked_capable_of_https_redirects":["zippy.nugs.test"]},{"ipv6":null,"type":"addon_domain","is_https_redirecting":"0","group":"user","homedir":"/home/user","owner":"root","serveradmin":"webmaster@seconddomain.example.com","serveralias":"seconddomain.com www.seconddomain.com www.seconddomain.example.com","all_aliases_valid":"0","domain":"seconddomain.com","ip":"192.168.0.128","userdirprotect":"","usecanonicalname":"Off","user":"user","can_https_redirect":"0","documentroot":"/home/user/public_html/seconddomain.com","hascgi":"1","no_cache_update":"0","is_temporary":"0","servername":"seconddomain.example.com"},{"owner":"root","homedir":"/home/user","group":"user","is_https_redirecting":"0","type":"addon_domain","ipv6":null,"servername":"subdomain.example.com","hascgi":"1","no_cache_update":"0","is_temporary":"0","can_https_redirect":"0","documentroot":"/home/user/public_html/subdomain","usecanonicalname":"Off","user":"user","ip":"192.168.0.128","userdirprotect":"","serveralias":"exampledomain.com www.exampledomain.com www.subdomain.example.com","domain":"exampledomain.com","serveradmin":"webmaster@subdomain.example.com","all_aliases_valid":"0"},{"servername":"subdomain.example.com","is_temporary":"0","no_cache_update":"0","hascgi":"1","documentroot":"/home/user/addondomain/home/dir","can_https_redirect":"0","user":"user","usecanonicalname":"Off","userdirprotect":"","ip":"192.168.0.128","domain":"addondomain.com","serveralias":"addondomain.com www.addondomain.com www.subdomain.example.com","serveradmin":"webmaster@subdomain.example.com","all_aliases_valid":"0","owner":"root","homedir":"/home/user","group":"user","is_https_redirecting":"0","type":"addon_domain","ipv6":null},{"is_https_redirecting":"0","type":"sub_domain","ipv6":null,"owner":"root","group":"user","homedir":"/home/user","userdirprotect":"","ip":"192.168.0.128","serveralias":"www.sub.example.com","serveradmin":"webmaster@sub.example.com","domain":"sub.example.com","all_aliases_valid":"0","servername":"sub.example.com","is_temporary":"0","no_cache_update":"0","hascgi":"1","documentroot":"/home/user/public_html/sub","can_https_redirect":"0","user":"user","usecanonicalname":"Off"}],"status":"1","errors":null,"metadata":{"transformed":"1"},"messages":null},"summary":"Output in list return format."},"hash":{"value":{"messages":null,"data":{"addon_domains":[{"is_temporary":"0","no_cache_update":"0","hascgi":"1","servername":"seconddomain.example.com","user":"user","usecanonicalname":"Off","documentroot":"/home/user/public_html/seconddomain.com","can_https_redirect":"0","userdirprotect":"","ip":"192.168.0.128","serveradmin":"webmaster@seconddomain.example.com","serveralias":"seconddomain.com www.seconddomain.com www.seconddomain.example.com","domain":"seconddomain.com","all_aliases_valid":"0","owner":"root","group":"user","homedir":"/home/user","is_https_redirecting":"0","ipv6":null,"type":"addon_domain"},{"documentroot":"/home/user/public_html/subdomain","can_https_redirect":"0","user":"user","usecanonicalname":"Off","servername":"subdomain.example.com","no_cache_update":"0","is_temporary":"0","hascgi":"1","serveralias":"exampledomain.com www.exampledomain.com www.subdomain.example.com","serveradmin":"webmaster@subdomain.example.com","domain":"exampledomain.com","all_aliases_valid":"0","ip":"192.168.0.128","userdirprotect":"","group":"user","homedir":"/home/user","owner":"root","type":"addon_domain","ipv6":null,"is_https_redirecting":"0"},{"can_https_redirect":"0","parked_capable_of_https_redirects":["parkeddomain.com"],"documentroot":"/home/user/addondomain/home/dir","hascgi":"1","is_temporary":"0","servername":"subdomain.example.com","serveralias":"addondomain.com www.addondomain.com www.subdomain.example.com","all_aliases_valid":"0","userdirprotect":"","homedir":"/home/user","parked_with_https_redirects":["parkeddomain.com"],"owner":"root","is_https_redirecting":"0","main_domain":{"userdirprotect":"","serveralias":"parkeddomain.com www.parkeddomain.com www.example.com","all_aliases_valid":"0","servername":"example.com","hascgi":"1","can_https_redirect":"0","documentroot":"/home/user/public_html","is_https_redirecting":"0","options":"ExecCGI Includes","ifmodulemodsuphpc":{"group":"user"},"owner":"root","scriptalias":[{"url":"/cgi-bin/","path":"/home/user/public_html/cgi-bin"},{"path":"/home/user/public_html/cgi-bin/","url":"/cgi-bin/"}],"homedir":"/home/user","ip":"192.168.0.128","domain":"example.com","serveradmin":"webmaster@example.com","port":"80","usecanonicalname":"Off","user":"user","type":"main_domain","customlog":[{"format":"combined","target":"/usr/local/apache/domlogs/example.com"},{"target":"/usr/local/apache/domlogs/example.com-bytes_log","format":"\"%{%s}t %I .\\n%{%s}t %O .\""}],"group":"user"},"parked_domains":["parkeddomain.com"],"usecanonicalname":"Off","user":"user","no_cache_update":"0","serveradmin":"webmaster@subdomain.example.com","domain":"addondomain.com","ip":"192.168.0.128","group":"user","sub_domains":[{"group":"user","homedir":"/home/user","owner":"root","type":"sub_domain","ipv6":null,"is_https_redirecting":"0","can_https_redirect":"0","documentroot":"/home/user/public_html/sub","usecanonicalname":"Off","user":"user","servername":"sub.example.com","hascgi":"1","no_cache_update":"0","is_temporary":"0","serveralias":"www.sub.example.com","serveradmin":"webmaster@sub.example.com","all_aliases_valid":"0","domain":"sub.example.com","ip":"192.168.0.128","userdirprotect":""}],"ipv6":null,"type":"addon_domain"}]},"status":"1","errors":null,"metadata":null},"summary":"Output in hash return format."}},"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"DomainInfo"},"result":{"type":"object","properties":{"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"oneOf":[{"$ref":"#/components/schemas/HashOutput"},{"$ref":"#/components/schemas/ListOutput"}],"description":"An object containing information about a cPanel account's domains. The output of this function changes, based on the `format` parameter value."},"metadata":{"properties":{}},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"type":"string","example":"domains_data","description":"The name of the method called."}},"type":"object"}}}}},"operationId":"domains_data","description":"This function lists user data for the cPanel account's domains.\n\n**Note:**\n\nThis function retrieves data from the `/var/cpanel/userdata/user/domain` file, where `user`\nrepresents the cPanel account username and `domain` represents the domain. For this reason,\nactual output may not contain all of the returns that this document lists.","parameters":[{"name":"format","in":"query","required":"false","description":"The function's return format.\n\n* `hash` — Use a hash format. The function will return objects based on the domain type.\n* `list` — Use a list format. The function will return an array of objects, where each object is a domain.","schema":{"example":"hash","enum":["hash","list"],"default":"hash","type":"string"}},{"schema":{"type":"integer","enum":["1","0"],"example":"1","default":"0"},"description":"Whether to return the secure redirect status of the addon domains.\n\n* `1` — Return the status.\n* `0` — Do **not** return the status.","required":"false","name":"return_https_redirects_status","in":"query"},{"required":"false","name":"hide_temporary_domains","in":"query","schema":{"enum":["1","0"],"example":"1","default":"0","type":"integer"},"description":"Whether to hide temporary domains from the response arrays.\n\n* `1` — Hide temporary domains from `addon_domains`, `sub_domains`, and `parked_domains` arrays.\n* `0` — Return all domains, including the temporary domains."}],"summary":"Return all domains' hosting configuration","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DomainInfo \\\n  domains_data\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DomainInfo/domains_data"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DomainInfo_domains_data.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DomainInfo_domains_data.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/DomainInfo/,\n    q/domains_data/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DomainInfo_domains_data.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DomainInfo_domains_data.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    'DomainInfo',\n    'domains_data'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["DomainInfo","Domain Information"]}}},"components":{"schemas":{"HashOutput":{"type":"object","properties":{"sub_domains":{"items":{"$ref":"#/components/schemas/Contents"},"description":"An array of objects containing information about each subdomain."},"addon_domains":{"items":{"$ref":"#/components/schemas/Contents"},"description":"An array of objects containing information about each addon domain."},"parked_domains":{"description":"An array of objects containing information about each parked domain.","items":{"$ref":"#/components/schemas/Contents"}},"main_domain":{"items":{"$ref":"#/components/schemas/MainDomainContents"},"description":"An array of objects containing information about the main domain."}}},"Contents":{"properties":{"type":{"type":"string","enum":["addon_domain","sub_domain","parked_domains"],"description":"The type of domain:\n\n* `addon_domain` — The domain is an addon domain.\n* `sub_domain` — The domain is a subdomain.\n* `parked_domain` — The domain is a parked domain (domain alias)."},"ipv6":{"type":"string","description":"The domain's IPv6 address.\n\n* null — The account does **not** use IPv6.","format":"ipv6","nullable":"true"},"is_https_redirecting":{"type":"integer","description":"Whether the domain redirects to `https`.\n\n* `1` — The domain redirects to `https`.\n* `0` — The domain does **not** redirect to `https`.\n\n**Note:**\n\nThis return **only** appears if you set the `return_https_redirects_status` parameter to `1`.","enum":["1","0"]},"group":{"type":"string","description":"The domain's group."},"homedir":{"type":"string","description":"The absolute path to the cPanel account's home directory.","format":"path"},"owner":{"description":"The WHM account (`root` or a reseller) that owns the cPanel account.","type":"string"},"serveralias":{"description":"A space-separated list of the domain's aliases.","format":"domain","type":"string"},"domain":{"description":"The domain's name.","format":"domain","type":"string"},"serveradmin":{"type":"string","description":"The domain's administrator's contact email address.","format":"email"},"all_aliases_valid":{"type":"integer","description":"Whether a valid SSL certificate exists on the domain's aliases.\n\n* `1` — A valid SSL certificate exists.\n* `0` — A valid SSL certificate does **not** exist.\n\n**Note:**\n\nThis return **only** appears if you set the `return_https_redirects_status` parameter to `1`.","enum":["1","0"]},"userdirprotect":{"type":"integer","enum":["1","0"],"description":"The domain's [Apache `mod_userdir` Tweak](https://go.cpanel.net/whmdocsApachemod_userdirTweak)\nsetting.\n\n* `1` — Enabled.\n* `0` — Disabled."},"ip":{"type":"string","format":"ipv4","description":"The domain's IPv4 address."},"documentroot":{"description":"The absolute path to the domain's document root.","format":"path","type":"string"},"can_https_redirect":{"type":"integer","description":"Whether a valid SSL certificate exists or AutoSSL runs on the domain.\n\n* `1` — A valid SSL certificate exists or AutoSSL runs.\n* `0` — A valid SSL certificate does **not** exist and AutoSSL does **not** run.\n\n**Note:**\n\nThis return **only** appears if you set the `return_https_redirects_status` parameter to `1`.","enum":["1","0"]},"user":{"format":"username","description":"The cPanel account's username.","type":"string"},"usecanonicalname":{"enum":["On","Off"],"description":"The domain's Canonical Name (CNAME) setting.\n\n* `On` — Use the domain's CNAME.\n* `Off` — Do **not** use the domain's CNAME.","type":"string"},"servername":{"description":"The domain's identifier on the server.","format":"domain","type":"string"},"is_temporary":{"type":"integer","description":"Whether the domain is a temporary domain.\n* `1` — The domain is temporary.\n* `0` — The domain is not temporary.","enum":["1","0"]},"no_cache_update":{"description":"Whether the domain is subject to cache updates.\n\n* `1` — The domain updates caches.\n* `0` — The domain does **not** update caches.","enum":["1","0"],"type":"integer"},"hascgi":{"enum":["1","0"],"description":"Whether CGI is enabled for the domain.\n\n* `1` — Enabled.\n* `0` — Disabled.","type":"integer"}}},"MainDomainContents":{"properties":{"no_cache_update":{"description":"Whether the domain is subject to cache updates.\n\n* `1` — The domain updates caches.\n* `0` — The domain does **not** update caches.","enum":["1","0"],"type":"integer"},"usecanonicalname":{"type":"string","description":"The domain's Canonical Name (CNAME) setting.\n\n* `On` — Use the domain's CNAME.\n* `Off` — Do **not** use the domain's CNAME.","enum":["On","Off"]},"user":{"type":"string","format":"username","description":"The cPanel account's username."},"ip":{"format":"ipv4","description":"The domain's IPv4 address.","type":"string"},"serveradmin":{"description":"The domain's administrator's contact email address.","format":"email","type":"string"},"domain":{"format":"domain","description":"The domain's name.","type":"string"},"customlog":{"description":"The domain's [Apache log](http://httpd.apache.org/docs/2.2/mod/mod_log_config.html)\ninformation.","properties":{"target":{"type":"string","description":"The absolute path to the domain's log file in the `domlogs` directory."},"format":{"type":"string","description":"The [log file](https://httpd.apache.org/docs/2.2/mod/mod_log_config.html#logformat)'s\nformat."}},"type":"object"},"group":{"description":"The domain's group.","type":"string"},"type":{"type":"string","enum":["main_domain"],"description":"The domain is the cPanel account's main domain.\n\n* `main_domain` is the only possible value."},"ipv6":{"type":"string","description":"The domain's IPv6 address.\n\n* null — The account does **not** use IPv6.","format":"ipv6","nullable":"true"},"servername":{"format":"domain","description":"The domain's identifier on the server.","type":"string"},"hascgi":{"enum":["1","0"],"description":"Whether CGI is enabled for the domain.\n\n* `1` — Enabled.\n* `0` — Disabled.","type":"integer"},"can_https_redirect":{"type":"integer","enum":["1","0"],"description":"Whether a valid SSL certificate exists or AutoSSL runs on the domain.\n\n* `1` — A valid SSL certificate exists or AutoSSL runs.\n* `0` — A valid SSL certificate does **not** exist and AutoSSL does **not** run.\n\n**Note:**\n\nThis return **only** appears if you set the `return_https_redirects_status` parameter to `1`."},"documentroot":{"type":"string","description":"The absolute path to the domain's document root.","format":"path"},"userdirprotect":{"description":"The domain's [Apache `mod_userdir` Tweak](https://go.cpanel.net/whmdocsApachemod_userdirTweak)\nsetting.\n\n* `1` — Enabled.\n* `0` — Disabled.","enum":["1","0"],"type":"integer"},"all_aliases_valid":{"description":"Whether a valid SSL certificate exists on the domain's aliases.\n\n* `1` — A valid SSL certificate exists.\n* `0` — A valid SSL certificate does **not** exist.\n\n**Note:**\n\nThis return **only** appears if you set the `return_https_redirects_status` parameter to `1`.","enum":["1","0"],"type":"integer"},"serveralias":{"description":"A space-separated list of the domain's aliases.","format":"domain","type":"string"},"ifmodulemodsuphpc":{"description":"Information about PHP scripts and suPHP.","type":"object","properties":{"group":{"type":"string","description":"If suPHP is enabled, PHP scripts run as this group."}}},"owner":{"type":"string","description":"The WHM account (`root` or a reseller) that owns the cPanel account."},"scriptalias":{"properties":{"url":{"description":"The domain's CGI directory.","format":"path","type":"string"},"path":{"type":"string","format":"path","description":"The absolute path to the domain's CGI directory."}},"type":"object","description":"The domain's CGI information."},"homedir":{"format":"path","description":"The absolute path to the cPanel account's home directory.","type":"string"},"is_https_redirecting":{"type":"integer","enum":["1","0"],"description":"Whether the domain redirects to `https`.\n\n* `1` — The domain redirects to `https`.\n* `0` — The domain does **not** redirect to `https`.\n\n**Note:**\n\nThis return **only** appears if you set the `return_https_redirects_status` parameter to `1`."}}},"ListOutput":{"anyOf":[{"$ref":"#/components/schemas/Contents"},{"$ref":"#/components/schemas/MainDomainContents"}]}},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}}},"primary_domain":{"tags":[{"description":"The DomainInfo module for UAPI.","name":"DomainInfo"},{"name":"Domain Information","description":"Domain Management / Domain Information"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Domain Information"],"name":"Domain Management"}],"paths":{"/DomainInfo/primary_domain":{"get":{"parameters":[{"description":"Whether to hide temporary domains from the response.\n\n* `1` — Return `null` if the main domain is a temporary domain.\n* `0` — Return the main domain if it's a temporary domain.","schema":{"type":"integer","enum":["1","0"],"example":"1","default":"0"},"in":"query","name":"hide_temporary_domains","required":"false"}],"description":"This function returns the cPanel account's main domain.","operationId":"primary_domain","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"data":{"type":"object","properties":{"primary_domain":{"nullable":"true","description":"The cPanel account's main domain.\n** Note: **\nThis return's value will be `null` if the `hide_temporary_domains` parameter is set to `1` and the main domain is a temporary domain.","example":"example.com","type":"string"}}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","type":"array"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"DomainInfo"},"func":{"type":"string","example":"primary_domain","description":"The name of the method called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DomainInfo \\\n  primary_domain\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DomainInfo/primary_domain","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DomainInfo_primary_domain.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DomainInfo_primary_domain.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/DomainInfo/,\n    q/primary_domain/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DomainInfo_primary_domain.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DomainInfo_primary_domain.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    'DomainInfo',\n    'primary_domain'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["DomainInfo","Domain Information"],"summary":"Return the cPanel account's primary domain","x-cpanel-api-version":"UAPI"}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"}}},"Postgresql":{"delete_database":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["PostgreSQL Database Management"],"name":"PostgreSQL"}],"paths":{"/Postgresql/delete_database":{"get":{"parameters":[{"schema":{"type":"string","example":"database"},"description":"The database's name.","required":"true","name":"name","in":"query"}],"description":"This function deletes a PostgreSQL® database.\n\n**Important:**\n\n  When you disable the [Postgres role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"Postgresql::delete_database","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"delete_database","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"nullable":"true","default":null,"type":"object"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}}},"module":{"type":"string","description":"The name of the module called.","example":"Postgresql"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","tags":["Postgresql","PostgreSQL Database Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  delete_database \\\n  name='database'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/delete_database?name=database"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_delete_database.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_delete_database.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/Postgresql/,\n    q/delete_database/,\n    {\n        'name' => 'database',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_delete_database.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_delete_database.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    'Postgresql',\n    'delete_database',\n    array (\n        'name' => 'database',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Delete PostgreSQL database"}}},"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"name":"PostgreSQL Database Management","description":"PostgreSQL / Database Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}]},"delete_user":{"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"name":"PostgreSQL User Management","description":"PostgreSQL / User Management"}],"paths":{"/Postgresql/delete_user":{"get":{"operationId":"Postgresql::delete_user","description":"This function deletes a PostgreSQL® user.\n\n**Important:**\n\n  When you disable the [PostgreSQL role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"example":"example","type":"string"},"description":"The PostgreSQL user's name.","required":"true","name":"name","in":"query"}],"x-cpanel-available-version":"cPanel 84","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"delete_user","description":"The name of the method called.","type":"string"},"result":{"properties":{"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"data":{"default":null,"nullable":"true","type":"object"},"status":{"type":"integer","description":"*`1` - Success.\n*`0` - Failed. Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"metadata":{"properties":{}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Postgresql"}}}}},"description":"HTTP Request was successful."}},"tags":["Postgresql","PostgreSQL User Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  delete_user \\\n  name='example'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/delete_user?name=example"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_delete_user.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_delete_user.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/Postgresql/,\n    q/delete_user/,\n    {\n        'name' => 'example',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_delete_user.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_delete_user.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    'Postgresql',\n    'delete_user',\n    array (\n        'name' => 'example',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Delete PostgreSQL user"}}},"x-tagGroups":[{"tags":["PostgreSQL User Management"],"name":"PostgreSQL"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"list_databases":{"x-tagGroups":[{"name":"PostgreSQL","tags":["PostgreSQL Database Management"]}],"paths":{"/Postgresql/list_databases":{"get":{"x-cpanel-available-version":"cPanel 84","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Postgresql"},"result":{"type":"object","properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"data":{"items":{"type":"object","properties":{"users":{"type":"array","minimum":"0","description":"An array of database usernames.\n\n**Note:**\n\n  If no users exist on a database, the function returns an empty array","items":{"example":"db_user","type":"string"}},"disk_usage":{"example":"673","description":"The disk space that the database uses, in bytes.","type":"integer"},"database":{"type":"string","description":"The database name.","example":"user_db"}}},"type":"array"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"type":"string","example":"list_databases","description":"The name of the method called."}},"type":"object"}}}}},"description":"This function lists an account's PostgreSQL® databases.\n\n**Important:**\n\n  When you disable the [*Postgres* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"Postgresql-list_databases","parameters":[],"summary":"Return PostgreSQL databases","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  list_databases\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/list_databases","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_list_databases.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_list_databases.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/Postgresql/,\n    q/list_databases/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_list_databases.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_list_databases.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    'Postgresql',\n    'list_databases'\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}"}],"tags":["Postgresql","PostgreSQL Database Management"]}}},"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"name":"PostgreSQL Database Management","description":"PostgreSQL / Database Management"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"create_database":{"x-tagGroups":[{"tags":["PostgreSQL Database Management"],"name":"PostgreSQL"}],"paths":{"/Postgresql/create_database":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"data":{"nullable":"true","default":null,"type":"object"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API."}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"Postgresql"},"func":{"description":"The name of the method called.","example":"create_database","type":"string"}}}}}}},"operationId":"Postgresql::create_database","description":"This function creates a PostgreSQL® database.\n\n**Important:**\n\nWhen you disable the [PostgreSQL role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","parameters":[{"required":"true","name":"name","in":"query","schema":{"type":"string","example":"database"},"description":"The database's name.\n\n**Note**:\n\n  If database prefixing is enabled, this parameter **must** include the database prefix for the account."}],"x-cpanel-api-version":"UAPI","summary":"Create PostgreSQL database","tags":["Postgresql","PostgreSQL Database Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  create_database \\\n  name='database'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/create_database?name=database","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_create_database.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_create_database.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/Postgresql/,\n    q/create_database/,\n    {\n        'name' => 'database',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_create_database.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_create_database.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    'Postgresql',\n    'create_database',\n    array (\n        'name' => 'database',\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}"}]}}},"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"name":"PostgreSQL Database Management","description":"PostgreSQL / Database Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"update_privileges":{"paths":{"/Postgresql/update_privileges":{"get":{"tags":["Postgresql","PostgreSQL User Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  update_privileges\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/update_privileges","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_update_privileges.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Postgresql_update_privileges.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/Postgresql/,\n    q/update_privileges/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_update_privileges.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Postgresql_update_privileges.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    'Postgresql',\n    'update_privileges'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Update PostgreSQL® privileges","parameters":[],"description":"This function synchronizes PostgreSQL® database user privileges on an account.\n\nSome versions of PostgreSQL are ANSI SQL-92 compliant and do not support recursive grants,\nwildcard grants, or future grants. If you use phpPgAdmin, or manually create new tables, and\nyou want multiple PostgreSQL users to access your PostgreSQL tables, you may either call this\nAPI function or click _Synchronize Grants_ in the _PostgreSQL Databases_ interface\n(_Home >> Databases >> PostgreSQL Databases_) after you add a table.\n\n**Important:**\n\nWhen you disable the [PostgreSQL role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"update_privileges","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"update_privileges"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"type":"object","default":null,"nullable":"true"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Postgresql"}}}}}}},"x-cpanel-available-version":"cPanel 84"}}},"x-tagGroups":[{"tags":["PostgreSQL User Management"],"name":"PostgreSQL"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"name":"PostgreSQL User Management","description":"PostgreSQL / User Management"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"list_users":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"description":"PostgreSQL / User Management","name":"PostgreSQL User Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"name":"PostgreSQL","tags":["PostgreSQL User Management"]}],"paths":{"/Postgresql/list_users":{"get":{"description":"This function lists an account's PostgreSQL® database users.\n\n**Important:**\n\nWhen you disable the [*PostgreSQL* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"Postgresql::list_users","parameters":[],"x-cpanel-available-version":"cPanel 84","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"Postgresql","description":"The name of the module called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","type":"array"},"data":{"example":["example_user1","example_user2"],"description":"An array of strings which are PostgreSQL database usernames.","items":{"example":"example_user1","type":"string"},"type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}}}},"func":{"type":"string","description":"The name of the method called.","example":"list_users"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  list_users\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/list_users","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_list_users.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_list_users.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/Postgresql/,\n    q/list_users/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_list_users.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_list_users.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    'Postgresql',\n    'list_users'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Postgresql","PostgreSQL User Management"],"summary":"Return PostgreSQL users","x-cpanel-api-version":"UAPI"}}}},"create_user":{"tags":[{"description":"The Postgresql module for UAPI.","name":"Postgresql"},{"name":"PostgreSQL User Management","description":"PostgreSQL / User Management"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["PostgreSQL User Management"],"name":"PostgreSQL"}],"paths":{"/Postgresql/create_user":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Postgresql","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"data":{"default":null,"nullable":"true","type":"integer"},"metadata":{"properties":{}},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}}},"func":{"type":"string","example":"create_user","description":"The name of the method called."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"description":"The database user's name.\n\n**Note:**\n\nIf database prefixing is enabled, this parameter **must** include the database prefix for the account.","schema":{"type":"string","example":"dbuser"},"in":"query","name":"name","required":"true"},{"description":"The new user's password.","schema":{"example":"123456luggage","type":"string"},"in":"query","name":"password","required":"true"}],"description":"This function creates a PostgreSQL® database user.\n\n**Important:**\n\nWhen you disable the [*PostgreSQL* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"create_user","x-cpanel-api-version":"UAPI","summary":"Create PostgreSQL user","tags":["Postgresql","PostgreSQL User Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  create_user \\\n  name='dbuser' \\\n  password='123456luggage'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/create_user?name=dbuser&password=123456luggage"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_create_user.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_create_user.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/Postgresql/,\n    q/create_user/,\n    {\n        'name' => 'dbuser',\n        'password' => '123456luggage',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_create_user.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_create_user.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    'Postgresql',\n    'create_user',\n    array (\n        'name' => 'dbuser',\n        'password' => '123456luggage',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"}},"set_password":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"tags":["PostgreSQL User Management"],"name":"PostgreSQL"}],"paths":{"/Postgresql/set_password":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update PostgreSQL user password","tags":["Postgresql","PostgreSQL User Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  set_password \\\n  user='dbuser' \\\n  password='12345luggage'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/set_password?user=dbuser&password=12345luggage"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_set_password.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_set_password.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/Postgresql/,\n    q/set_password/,\n    {\n        'user' => 'dbuser',\n        'password' => '12345luggage',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_set_password.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_set_password.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    'Postgresql',\n    'set_password',\n    array (\n        'user' => 'dbuser',\n        'password' => '12345luggage',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"Postgresql","description":"The name of the module called.","type":"string"},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"data":{"type":"object","default":null,"nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"description":"The name of the method called.","example":"set_password","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function changes a PostgreSQL® database user's password.\n\n**Important:**\n\n  When you disable the [Postgres role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"set_password","parameters":[{"description":"The database user's name.\n\n**Note:**\n\nIf database prefixing is enabled, this parameter **must** include the database prefix for the account.","schema":{"type":"string","example":"dbuser"},"name":"user","in":"query","required":"true"},{"name":"password","in":"query","required":"true","description":"The user's new password.","schema":{"type":"string","example":"12345luggage"}}]}}},"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"name":"PostgreSQL User Management","description":"PostgreSQL / User Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}]},"revoke_all_privileges":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"description":"PostgreSQL / User Management","name":"PostgreSQL User Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"PostgreSQL","tags":["PostgreSQL User Management"]}],"paths":{"/Postgresql/revoke_all_privileges":{"get":{"summary":"Remove PostgreSQL user privileges","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  revoke_all_privileges \\\n  user='example_dbuser' \\\n  database='example_database'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/revoke_all_privileges?user=example_dbuser&database=example_database"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_revoke_all_privileges.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_revoke_all_privileges.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/Postgresql/,\n    q/revoke_all_privileges/,\n    {\n        'user' => 'example_dbuser',\n        'database' => 'example_database',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_revoke_all_privileges.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_revoke_all_privileges.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    'Postgresql',\n    'revoke_all_privileges',\n    array (\n        'user' => 'example_dbuser',\n        'database' => 'example_database',\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}"}],"tags":["Postgresql","PostgreSQL User Management"],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","example":"Postgresql","description":"The name of the module called."},"result":{"properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","nullable":"true","type":"array"},"data":{"nullable":"true","default":null,"type":"object"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details."},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"description":"The name of the method called.","example":"revoke_all_privileges","type":"string"}}}}}}},"description":"This function revokes all privileges for a PostgreSQL® database from a database user.\n\n**Important:**\n\nWhen you disable the [*PostgreSQL* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"revoke_all_privileges","parameters":[{"schema":{"example":"example_dbuser","type":"string"},"description":"The database user's name.\n\n**Note**\n\nIf database prefixing is enabled, this value **must** include the database prefix for the account.","required":"true","name":"user","in":"query"},{"description":"The database's name.\n\n**Note**\n\nIf database prefixing is enabled, this value **must** include the database prefix for the account.","schema":{"type":"string","example":"example_database"},"name":"database","in":"query","required":"true"}]}}}},"rename_user_no_password":{"tags":[{"description":"The Postgresql module for UAPI.","name":"Postgresql"},{"description":"PostgreSQL / User Management","name":"PostgreSQL User Management"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"PostgreSQL","tags":["PostgreSQL User Management"]}],"paths":{"/Postgresql/rename_user_no_password":{"get":{"parameters":[{"description":"The database user's current name.\n\n**Note:**\n\nIf database prefixing is enabled, this parameter **must** include the database prefix for the account.","schema":{"type":"string","example":"dbuser"},"in":"query","name":"oldname","required":"true"},{"schema":{"type":"string","example":"dbuser2"},"description":"The database user's new name.\n\n**Note:**\n\nIf database prefixing is enabled, this parameter **must** include the database prefix for the account.","required":"true","name":"newname","in":"query"}],"operationId":"rename_user_no_password","description":"This function renames a PostgreSQL® database user.\n\n**Warning:**\n\n* If you rename a PostgreSQL user, you **must** set the password for the database user. This is required because of the md5 hash that PostgreSQL creates to store user passwords.\n* We **strongly** recommend that you use the `Postgresql::rename_user function` instead of this one.\n\n**Important:**\n\nWhen you disable the  [*PostgreSQL* role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null,"nullable":"true","type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"default":null,"nullable":"true","type":"object"}}},"module":{"example":"Postgresql","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"rename_user_no_password","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","tags":["Postgresql","PostgreSQL User Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  rename_user_no_password \\\n  oldname='dbuser' \\\n  newname='dbuser2'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/rename_user_no_password?oldname=dbuser&newname=dbuser2"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_rename_user_no_password.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_rename_user_no_password.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/Postgresql/,\n    q/rename_user_no_password/,\n    {\n        'oldname' => 'dbuser',\n        'newname' => 'dbuser2',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_rename_user_no_password.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_rename_user_no_password.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    'Postgresql',\n    'rename_user_no_password',\n    array (\n        'oldname' => 'dbuser',\n        'newname' => 'dbuser2',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Update PostgreSQL username without password"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"rename_database":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"name":"Postgresql","description":"The Postgresql module for UAPI."},{"description":"PostgreSQL / Database Management","name":"PostgreSQL Database Management"}],"paths":{"/Postgresql/rename_database":{"get":{"description":"This function renames a PostgreSQL® database.\n\n**Important:**\n\nWhen you disable the [*PostgreSQL* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"rename_database","parameters":[{"schema":{"example":"database","type":"string"},"description":"The database's current name.\n\n**Note:**\n\nIf database prefixing is enabled, this parameter **must** include the database prefix for the account.","required":"true","in":"query","name":"oldname"},{"name":"newname","in":"query","required":"true","description":"The database's new name.\n\n**Note:**\n\nIf database prefixing is enabled, this parameter **must** include the database prefix for the account.","schema":{"type":"string","example":"database2"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"rename_database","description":"The name of the method called."},"module":{"example":"Postgresql","description":"The name of the module called.","type":"string"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{}},"data":{"default":null,"nullable":"true","type":"object"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  rename_database \\\n  oldname='database' \\\n  newname='database2'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/rename_database?oldname=database&newname=database2"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_rename_database.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_rename_database.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/Postgresql/,\n    q/rename_database/,\n    {\n        'oldname' => 'database',\n        'newname' => 'database2',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_rename_database.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_rename_database.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    'Postgresql',\n    'rename_database',\n    array (\n        'oldname' => 'database',\n        'newname' => 'database2',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Postgresql","PostgreSQL Database Management"],"summary":"Update PostgreSQL database name","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["PostgreSQL Database Management"],"name":"PostgreSQL"}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"get_restrictions":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"tags":[{"description":"The Postgresql module for UAPI.","name":"Postgresql"},{"description":"PostgreSQL / Database Management","name":"PostgreSQL Database Management"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["PostgreSQL Database Management"],"name":"PostgreSQL"}],"paths":{"/Postgresql/get_restrictions":{"get":{"operationId":"Postgresql::get_restrictions","description":"This function retrieves the PostgreSQL® user and database name length restrictions.\n\n**Important:**\n\nWhen you disable the [*PostgreSQL* role](https://go.cpanel.net/serverroles), the system **disables** this function.      ","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Postgresql"},"result":{"properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"properties":{"max_username_length":{"example":"63","description":"The maximum length of a database username.","type":"integer","minimum":"1"},"max_database_name_length":{"type":"integer","minimum":"1","description":"The maximum length of a database name.","example":"63"},"prefix":{"type":"string","example":"example_","description":"If database prefixing is enabled, this return outputs the database prefix. A valid string up to eight characters and an underscore (`_`)."}},"type":"object"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"get_restrictions"}}}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  get_restrictions\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/get_restrictions","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_get_restrictions.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_get_restrictions.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/Postgresql/,\n    q/get_restrictions/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_get_restrictions.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_get_restrictions.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    'Postgresql',\n    'get_restrictions'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Postgresql","PostgreSQL Database Management"],"summary":"Return PostgreSQL name length restrictions","x-cpanel-api-version":"UAPI"}}}},"rename_user":{"paths":{"/Postgresql/rename_user":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update PostgreSQL username","tags":["Postgresql","PostgreSQL User Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  rename_user \\\n  oldname='dbuser' \\\n  newname='dbuser2' \\\n  password='123456luggage'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/rename_user?oldname=dbuser&newname=dbuser2&password=123456luggage"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_rename_user.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_rename_user.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/Postgresql/,\n    q/rename_user/,\n    {\n        'oldname' => 'dbuser',\n        'newname' => 'dbuser2',\n        'password' => '123456luggage',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_rename_user.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_rename_user.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    'Postgresql',\n    'rename_user',\n    array (\n        'oldname' => 'dbuser',\n        'newname' => 'dbuser2',\n        'password' => '123456luggage',\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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"rename_user","description":"The name of the method called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"data":{"nullable":"true","default":null,"type":"object"},"status":{"description":"* `1` - Success\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"description":"The name of the module called.","example":"Postgresql","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"schema":{"type":"string","example":"dbuser"},"description":"The database user's current name.\n\n**Note:**\n\nIf database prefixing is enabled, this parameter **must** include the database prefix for the account.","required":"true","name":"oldname","in":"query"},{"schema":{"example":"dbuser2","type":"string"},"description":"The database user's new name.\n\n**Note:**\n\nIf database prefixing is enabled, this parameter **must** include the database prefix for the account.","required":"true","name":"newname","in":"query"},{"required":"true","name":"password","in":"query","schema":{"type":"string","example":"123456luggage"},"description":"The database user's new password."}],"description":"This function renames a PostgreSQL® database user.\n\n**Important:**\n\nWhen you disable the [*PostgreSQL* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"Postgresql::rename_user"}}},"x-tagGroups":[{"name":"PostgreSQL","tags":["PostgreSQL User Management"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"description":"The Postgresql module for UAPI.","name":"Postgresql"},{"description":"PostgreSQL / User Management","name":"PostgreSQL User Management"}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"grant_all_privileges":{"x-tagGroups":[{"name":"PostgreSQL","tags":["PostgreSQL User Management"]}],"paths":{"/Postgresql/grant_all_privileges":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"module":{"type":"string","example":"Postgresql","description":"The name of the module called."},"func":{"example":"grant_all_privileges","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"description":"This function grants all privileges for a PostgreSQL® database to a database user.\n\n**Important:**\n\nWhen you disable the [*PostgreSQL* role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","operationId":"grant_all_privileges","parameters":[{"in":"query","name":"user","required":"true","description":"The database user's name.\n\n**Note**\n\nIf database prefixing is enabled, this value **must** include the database prefix for the account.","schema":{"type":"string","example":"example_dbuser"}},{"required":"true","name":"database","in":"query","schema":{"example":"example_database","type":"string"},"description":"The database's name.\n\n**Note**\n\nIf database prefixing is enabled, this value **must** include the database prefix for the account."}],"x-cpanel-api-version":"UAPI","summary":"Enable all user privileges on PostgreSQL database","tags":["Postgresql","PostgreSQL User Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Postgresql \\\n  grant_all_privileges \\\n  user='example_dbuser' \\\n  database='example_database'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Postgresql/grant_all_privileges?user=example_dbuser&database=example_database","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Postgresql_grant_all_privileges.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Postgresql_grant_all_privileges.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/Postgresql/,\n    q/grant_all_privileges/,\n    {\n        'user' => 'example_dbuser',\n        'database' => 'example_database',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Postgresql_grant_all_privileges.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Postgresql_grant_all_privileges.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    'Postgresql',\n    'grant_all_privileges',\n    array (\n        'user' => 'example_dbuser',\n        'database' => 'example_database',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"tags":[{"description":"The Postgresql module for UAPI.","name":"Postgresql"},{"description":"PostgreSQL / User Management","name":"PostgreSQL User Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"openapi":"3.0.2"}},"ImageManager":{"create_thumbnails":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"tags":["Image Tools"],"name":"Files"}],"paths":{"/ImageManager/create_thumbnails":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"create_thumbnails"},"module":{"example":"ImageManager","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"status":{"description":"- 1 - Success.\n- 0 - Failed. Check the ``errors`` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"data":{"type":"array","items":{"type":"object","properties":{"failed":{"description":"Whether the function failed to create the thumbnail file.\n\n**Note:**\n\n * The function **only** returns this value if it doesn't create the thumbnail.\n * `1` is the **only** possible value.","enum":["1"],"example":"1","type":"integer"},"thumbnail_file":{"type":"string","example":"/home/cptest1/public_html/images/thumbnails/tn_610_290.jpg","description":"The thumbnail file that the function generated. An absolute filepath."},"reason":{"type":"string","example":"too many pixels","description":"The reason that the function didn't create the thumbnail file.\n\n**Note:**\n\n The function only returns this value if it doesn't create the thumbnail."},"file":{"type":"string","example":"/home/cptest1/public_html/images/610_290.jpg","description":"The file from which the function generated the thumbnail file. An absolute filepath."}}},"description":"An array of objects containing thumbnail file information."},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 82","parameters":[{"in":"query","name":"dir","required":"true","description":"The path to the directory where the image resides. When you pass this parameter, the function creates a thumbnail directory directly below the image directory.\n\n**NOTE:**\n\nThis parameter can use an absolute directory path or a path relative to the user's home directory.","schema":{"type":"string","example":"images"}},{"required":"true","name":"width_percentage","in":"query","schema":{"example":"25","minimum":"1","type":"integer","maximum":"99"},"description":"The percentage by which to reduce the thumbnails' width."},{"description":"The percentage by which to reduce the thumbnails' height.","schema":{"example":"25","maximum":"99","type":"integer","minimum":"1"},"in":"query","name":"height_percentage","required":"true"}],"operationId":"create_thumbnails","description":"This function creates thumbnails from images. The function saves the new thumbnail images in a thumbnails subdirectory inside the original directory. The system prepends thumbnail filenames with ``tn_`` (for example, ``tn_picture.jpg``).\n\n**Important:**\n\nWhen you disable the [WebServer role](https://go.cpanel.net/serverroles), the system disables this function.","x-cpanel-api-version":"UAPI","summary":"Create image thumbnails","tags":["ImageManager","Image Tools"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ImageManager \\\n  create_thumbnails \\\n  dir='images' \\\n  width_percentage='25' \\\n  height_percentage='25'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/ImageManager/create_thumbnails?dir=images&width_percentage=25&height_percentage=25"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ImageManager_create_thumbnails.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ImageManager_create_thumbnails.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/ImageManager/,\n    q/create_thumbnails/,\n    {\n        'dir' => 'images',\n        'width_percentage' => '25',\n        'height_percentage' => '25',\n    }\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ImageManager_create_thumbnails.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ImageManager_create_thumbnails.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    'ImageManager',\n    'create_thumbnails',\n    array (\n        'dir' => 'images',\n        'width_percentage' => '25',\n        'height_percentage' => '25',\n    )\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}"}]}}},"tags":[{"name":"ImageManager","description":"The ImageManager module for UAPI."},{"name":"Image Tools","description":"Files / Image Tools"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}]},"convert_file":{"x-tagGroups":[{"name":"Files","tags":["Image Tools"]}],"paths":{"/ImageManager/convert_file":{"get":{"summary":"Create image with new format","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ImageManager \\\n  convert_file \\\n  image_file='images/myimage.jpg' \\\n  type='png'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ImageManager/convert_file?image_file=images%2fmyimage.jpg&type=png","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ImageManager_convert_file.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ImageManager_convert_file.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/ImageManager/,\n    q/convert_file/,\n    {\n        'image_file' => 'images/myimage.jpg',\n        'type' => 'png',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ImageManager_convert_file.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ImageManager_convert_file.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    'ImageManager',\n    'convert_file',\n    array (\n        'image_file' => 'images/myimage.jpg',\n        'type' => 'png',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["ImageManager","Image Tools"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"convert_file","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"status":{"type":"integer","description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"type":"object","properties":{"converted_file":{"description":"The new absolute filepath to the image.","example":"/home/cptest1/images/myimage.png","type":"string"}}},"metadata":{"properties":{}}}},"module":{"example":"ImageManager","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 82","parameters":[{"name":"image_file","in":"query","required":"true","description":"The image file to convert, relative to the cPanel account's `/home` directory.","schema":{"type":"string","example":"images/myimage.jpg"}},{"name":"type","in":"query","required":"true","description":"The format to which to convert the images.","schema":{"example":"png","type":"string"}}],"description":"This function converts an image to a new file format.\n\n**Important:**\n\nWhen you disable the [WebServer role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.","operationId":"convert_file"}}},"tags":[{"name":"ImageManager","description":"The ImageManager module for UAPI."},{"name":"Image Tools","description":"Files / Image Tools"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2"},"resize_image":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/ImageManager/resize_image":{"get":{"description":"This function resizes a specified image.\n\n**Important:**\n\nWhen you disable the [WebServer role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.","operationId":"resize_image","parameters":[{"description":"The name of the file to scale.\n\n**Note:**\n\nUse the absolute filepath or a filepath relative to the user's home directory.","schema":{"example":"/images/image.jpg","type":"string"},"name":"image_file","in":"query","required":"true"},{"in":"query","name":"width","required":"true","description":"The width to which to set the image size.","schema":{"minimum":"1","type":"integer","example":"200"}},{"name":"height","in":"query","required":"true","description":"The height to which to set the image size.","schema":{"example":"300","type":"integer","minimum":"1"}},{"in":"query","name":"save_original_as","required":"false","description":"The path to the directory in which to save a copy the original\nimage file.\n\n**Note:**\n\n* If you don't pass this parameter, the function doesn't save\na copy of the original image.\n* Use the absolute filepath or a filepath relative to the user's home directory.","schema":{"example":"images/original.jpg","type":"string"}}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"ImageManager","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"type":"string","example":"/home/cptest1/images/myimage.jpg","description":"The absolute filepath to the resized image."},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","example":"resize_image","description":"The name of the method called."}},"type":"object"}}}}},"tags":["ImageManager","Image Tools"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ImageManager \\\n  resize_image \\\n  image_file='images/image.jpg' \\\n  width='200' \\\n  height='300'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ImageManager/resize_image?image_file=%2fimages%2fimage.jpg&width=200&height=300","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ImageManager_resize_image.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ImageManager_resize_image.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/ImageManager/,\n    q/resize_image/,\n    {\n        'image_file' => '/images/image.jpg',\n        'width' => '200',\n        'height' => '300',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ImageManager_resize_image.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ImageManager_resize_image.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    'ImageManager',\n    'resize_image',\n    array (\n        'image_file' => '/images/image.jpg',\n        'width' => '200',\n        'height' => '300',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Save resized image"}}},"x-tagGroups":[{"tags":["Image Tools"],"name":"Files"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"ImageManager","description":"The ImageManager module for UAPI."},{"description":"Files / Image Tools","name":"Image Tools"}]},"get_dimensions":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"tags":[{"description":"The ImageManager module for UAPI.","name":"ImageManager"},{"name":"Image Tools","description":"Files / Image Tools"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Files","tags":["Image Tools"]}],"paths":{"/ImageManager/get_dimensions":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return image dimensions","tags":["ImageManager","Image Tools"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ImageManager \\\n  get_dimensions \\\n  image_file='image/myimage.jpg'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/ImageManager/get_dimensions?image_file=image%2fmyimage.jpg"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ImageManager_get_dimensions.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/ImageManager_get_dimensions.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/ImageManager/,\n    q/get_dimensions/,\n    {\n        'image_file' => 'image/myimage.jpg',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ImageManager_get_dimensions.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/ImageManager_get_dimensions.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    'ImageManager',\n    'get_dimensions',\n    array (\n        'image_file' => 'image/myimage.jpg',\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}"}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_dimensions","description":"The name of the method called.","type":"string"},"result":{"properties":{"status":{"example":"1","enum":["0","1"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"properties":{"width":{"example":"261","description":"The image's width, in pixels.","type":"integer","minimum":"1"},"height":{"description":"The image's height, in pixels.","example":"300","type":"integer","minimum":"1"}},"type":"object"},"metadata":{"properties":{}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"ImageManager"}}}}},"description":"HTTP Request was successful."}},"description":"This function returns the dimensions of the image file that you specify.\n\n**Important:**\n\nWhen you disable the [WebServer role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.","operationId":"get_dimensions","parameters":[{"schema":{"type":"string","example":"image/myimage.jpg"},"description":"The path to the file to measure.\n\n**Note:**\n\nUse the absolute filepath or a path relative to the user's home directory.","required":"true","name":"image_file","in":"query"}]}}}}},"CPDAVD":{"list_users":{"tags":[{"name":"CPDAVD","description":"The CPDAVD module for UAPI."},{"name":"Calendar and Contacts (DAV)","description":"Optional Applications / Calendar and Contacts (DAV)"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}],"paths":{"/CPDAVD/list_users":{"get":{"description":"This function lists the users that are available for use with CalDAV and CardDAV","operationId":"CPDAVD_list_users","parameters":[],"x-cpanel-available-version":"cPanel 120","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"items":{"example":{"someone@example.com":{"addressbook":{"type":"VADDRESSBOOK","protected":"1","displayname":"cPanel CardDAV Address Book","description":"Default Address Book automatically created for your account."},"calendar":{"description":"Default Calendar automatically created for your account.","calendar-color":"#ff6c2c","displayname":"cPanel CalDAV Calendar","protected":"1","type":"VCALENDAR"}}},"type":"object","additionalProperties":{"description":"The name of this property is the principal name.","type":"object","additionalProperties":{"description":"The name of this property is the collection id.","properties":{"type":{"type":"string","enum":["VADDRESSBOOK","VCALENDAR","VTODO"],"example":"VCALENDAR","description":"The type of the collection."},"protected":{"type":"integer","description":"If this value is `1`, then the collection cannot be deleted through the API.","enum":["0","1"],"example":"1"},"displayname":{"description":"The name of the collection.","type":"string"},"calendar-color":{"type":"string","example":"#ee5555","description":"For calendars only: The color to use for calendar events."},"description":{"description":"The description of the collection.","type":"string"}},"type":"object"}}},"type":"array"},"metadata":{"properties":{}}},"type":"object"},"module":{"type":"string","example":"CPDAVD","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"list_users"}},"type":"object"}}}}},"tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CPDAVD \\\n  list_users\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/CPDAVD/list_users","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CPDAVD_list_users.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CPDAVD_list_users.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/CPDAVD/,\n    q/list_users/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CPDAVD_list_users.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CPDAVD_list_users.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    'CPDAVD',\n    'list_users'\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}\n"}],"x-cpanel-api-version":"UAPI","summary":"Update calendar sharing"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.119.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"remove_delegate":{"openapi":"3.0.2","info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.119.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"servers":[{"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."}},"description":"A server running cPanel."}],"tags":[{"description":"The CPDAVD module for UAPI.","name":"CPDAVD"},{"name":"Calendar and Contacts (DAV)","description":"Optional Applications / Calendar and Contacts (DAV)"}],"paths":{"/CPDAVD/remove_delegate":{"get":{"x-cpanel-available-version":"cPanel 120","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"CPDAVD","description":"The name of the module called."},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"shared":{"type":"integer","description":"Whether the sharing removal succeeded.\n* `1` — Removed.\n* `0` — **Not** removed.","example":"1","enum":["0","1"]}}},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","description":"The name of the method called.","example":"remove_delegate"}},"type":"object"}}}}},"operationId":"CPDAVD_remove_delegate","description":"This function removes a share for the specified calendar.","parameters":[{"required":"true","in":"query","name":"delegator","schema":{"example":"first@example.com","type":"string"},"description":"The owner of the calendar, who wishes to remove the sharing."},{"in":"query","name":"delegatee","required":"true","description":"The person to whom the calendar was shared.","schema":{"example":"second@example.com","type":"string"}},{"description":"The calendar that was shared.","schema":{"type":"string","example":"calendar"},"in":"query","name":"calendar","required":"true"}],"summary":"Remove a share.","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CPDAVD \\\n  remove_delegate \\\n  delegator='first@example.com' \\\n  delegatee='second@example.com' \\\n  calendar='calendar'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/CPDAVD/remove_delegate?delegator=first%40example.com&delegatee=second%40example.com&calendar=calendar"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CPDAVD_remove_delegate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CPDAVD_remove_delegate.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/CPDAVD/,\n    q/remove_delegate/,\n    {\n        'delegator' => 'first@example.com',\n        'delegatee' => 'second@example.com',\n        'calendar' => 'calendar',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CPDAVD_remove_delegate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CPDAVD_remove_delegate.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    'CPDAVD',\n    'remove_delegate',\n    array (\n        'delegator' => 'first@example.com',\n        'delegatee' => 'second@example.com',\n        'calendar' => 'calendar',\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","lang":"PHP","label":"LiveAPI PHP"}],"tags":["DAV","Calendar and Contacts (DAV)"]}}},"x-tagGroups":[{"tags":["Calendar and Contacts (DAV)"],"name":"Optional Applications"}]},"manage_collection":{"paths":{"/CPDAVD/manage_collection":{"get":{"x-cpanel-api-version":"UAPI","summary":"Perform an operation on a calendar, task list or address book.","tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CPDAVD \\\n  manage_collection \\\n  account='user@example.com' \\\n  action='delete' \\\n  path='/calendars/user@example.com/mycalendar' \\\n  collection_type='calendar'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/CPDAVD/manage_collection?account=user%40example.com&action=delete&path=%2fcalendars%2fuser%40example.com%2fmycalendar&collection_type=calendar","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CPDAVD_manage_collection.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CPDAVD_manage_collection.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/CPDAVD/,\n    q/manage_collection/,\n    {\n        'account' => 'user@example.com',\n        'action' => 'delete',\n        'path' => '/calendars/user@example.com/mycalendar',\n        'collection_type' => 'calendar',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CPDAVD_manage_collection.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CPDAVD_manage_collection.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    'CPDAVD',\n    'manage_collection',\n    array (\n        'account' => 'user@example.com',\n        'action' => 'delete',\n        'path' => '/calendars/user@example.com/mycalendar',\n        'collection_type' => 'calendar',\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","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 120","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"CPDAVD","type":"string"},"result":{"properties":{"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"object","properties":{"shared":{"type":"integer","description":"Whether the operation succeeded.\n* `1` — Operation succeeded.\n* `0` — Operation did **not** succeed.","example":"1","enum":["0","1"]}}},"metadata":{"properties":{}},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"description":"The name of the method called.","example":"manage_collection","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function creates, updates, or deletes a collection.","operationId":"CPDAVD_manage_collection","parameters":[{"description":"The owner of the calendar.","schema":{"example":"user@example.com","type":"string"},"in":"query","name":"account","required":"true"},{"required":"true","in":"query","name":"action","schema":{"example":"delete","enum":["create","update","delete"],"type":"string"},"description":"The action to perform (create, update, or delete a collection)."},{"required":"true","name":"path","in":"query","schema":{"example":"/calendars/user@example.com/mycalendar","type":"string"},"description":"The path to the collection."},{"name":"collection_type","in":"query","required":"true","description":"The collection type.","schema":{"enum":["calendar","tasks","addressbook"],"example":"calendar","type":"string"}},{"name":"name","in":"query","description":"The name of the collection. Required when creating a collection.","schema":{"example":"My Calendar","type":"string"}},{"description":"The description of the collection.","schema":{"example":"This is my calendar.","type":"string"},"in":"query","name":"description"},{"in":"query","name":"calendar-color","required":"false","description":"The color of the calendar, if applicable.","schema":{"type":"string","example":"#ee5555"}}]}}},"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"CPDAVD","description":"The CPDAVD module for UAPI."},{"description":"Optional Applications / Calendar and Contacts (DAV)","name":"Calendar and Contacts (DAV)"}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.119.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"add_delegate":{"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.119.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/CPDAVD/add_delegate":{"get":{"x-cpanel-available-version":"cPanel 120","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"add_delegate","description":"The name of the method called.","type":"string"},"result":{"properties":{"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"properties":{"shared":{"enum":["0","1"],"example":"1","description":"Whether the sharing succeeded.\n* `1` — Shared.\n* `0` — **Not** shared.","type":"integer"}},"type":"object"},"status":{"type":"integer","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"CPDAVD"}},"type":"object"}}}}},"description":"This function adds a share for the specified calendar.","operationId":"CPDAVD_add_delegate","parameters":[{"required":"true","in":"query","name":"delegator","schema":{"example":"first@example.com","type":"string"},"description":"The owner of the calendar, who wishes to share it to another user."},{"in":"query","name":"delegatee","required":"true","description":"The person to whom you will share the calendar.","schema":{"example":"second@example.com","type":"string"}},{"description":"The calendar to share.","schema":{"type":"string","example":"calendar"},"in":"query","name":"calendar","required":"true"},{"required":"false","in":"query","name":"readonly","schema":{"type":"integer","example":"1","enum":["0","1"]},"description":"If set, the provided access will be read-only."}],"x-cpanel-api-version":"UAPI","summary":"Share a calendar","tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CPDAVD \\\n  add_delegate \\\n  delegator='first@example.com' \\\n  delegatee='second@example.com' \\\n  calendar='calendar'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/CPDAVD/add_delegate?delegator=first%40example.com&delegatee=second%40example.com&calendar=calendar","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CPDAVD_add_delegate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CPDAVD_add_delegate.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/CPDAVD/,\n    q/add_delegate/,\n    {\n        'delegator' => 'first@example.com',\n        'delegatee' => 'second@example.com',\n        'calendar' => 'calendar',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CPDAVD_add_delegate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CPDAVD_add_delegate.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    'CPDAVD',\n    'add_delegate',\n    array (\n        'delegator' => 'first@example.com',\n        'delegatee' => 'second@example.com',\n        'calendar' => 'calendar',\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-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"CPDAVD","description":"The CPDAVD module for UAPI."},{"name":"Calendar and Contacts (DAV)","description":"Optional Applications / Calendar and Contacts (DAV)"}]},"list_delegates":{"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.119.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The CPDAVD module for UAPI.","name":"CPDAVD"},{"description":"Optional Applications / Calendar and Contacts (DAV)","name":"Calendar and Contacts (DAV)"}],"paths":{"/CPDAVD/list_delegates":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"CPDAVD"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"items":{"properties":{"delegatee":{"example":"second@example.com","description":"The person to whom the owner of the calendar shared it.","type":"string"},"delegator":{"type":"string","example":"first@example.com","description":"The owner of the calendar."},"readonly":{"example":"0","enum":["0","1"],"description":"If set to `1`, the `delegatee` only has read access to the calendar.","type":"integer"},"calendar":{"type":"string","example":"calendar","description":"The calendar id."},"calname":{"example":"cPanel CalDAV Calendar","description":"The name of the calendar.","type":"string"}},"type":"object"},"type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null,"nullable":"true"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"example":"list_delegates","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 120","parameters":[],"description":"This function lists the sharing configuration in calendars for this account.","operationId":"CPDAVD_list_delegates","x-cpanel-api-version":"UAPI","summary":"List calendar sharing.","tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CPDAVD \\\n  list_delegates\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/CPDAVD/list_delegates"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CPDAVD_list_delegates.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CPDAVD_list_delegates.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/CPDAVD/,\n    q/list_delegates/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CPDAVD_list_delegates.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CPDAVD_list_delegates.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    'CPDAVD',\n    'list_delegates'\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}\n"}]}}},"x-tagGroups":[{"tags":["Calendar and Contacts (DAV)"],"name":"Optional Applications"}]},"update_delegate":{"x-tagGroups":[{"name":"Optional Applications","tags":["Calendar and Contacts (DAV)"]}],"paths":{"/CPDAVD/update_delegate":{"get":{"parameters":[{"description":"The owner of the calendar, who wishes to change the details of the sharing.","schema":{"type":"string","example":"first@example.com"},"name":"delegator","in":"query","required":"true"},{"required":"true","in":"query","name":"delegatee","schema":{"type":"string","example":"second@example.com"},"description":"The person to whom you will share the calendar."},{"description":"The calendar to share.","schema":{"example":"calendar","type":"string"},"in":"query","name":"calendar","required":"true"},{"in":"query","name":"readonly","required":"false","description":"If set, the provided access will be read-only.","schema":{"type":"integer","enum":["0","1"],"example":"1"}}],"operationId":"CPDAVD_update_delegate","description":"This function updates a share for the specified calendar.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"update_delegate","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"CPDAVD"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details."},"data":{"properties":{"shared":{"type":"integer","description":"Whether the sharing succeeded.\n* `1` — Shared.\n* `0` — **Not** shared.","enum":["0","1"],"example":"1"}},"type":"object"},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}}}}}}}},"x-cpanel-available-version":"cPanel 120","tags":["DAV","Calendar and Contacts (DAV)"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CPDAVD \\\n  update_delegate \\\n  delegator='first@example.com' \\\n  delegatee='second@example.com' \\\n  calendar='calendar'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/CPDAVD/update_delegate?delegator=first%40example.com&delegatee=second%40example.com&calendar=calendar"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CPDAVD_update_delegate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CPDAVD_update_delegate.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/CPDAVD/,\n    q/update_delegate/,\n    {\n        'delegator' => 'first@example.com',\n        'delegatee' => 'second@example.com',\n        'calendar' => 'calendar',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CPDAVD_update_delegate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CPDAVD_update_delegate.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    'CPDAVD',\n    'update_delegate',\n    array (\n        'delegator' => 'first@example.com',\n        'delegatee' => 'second@example.com',\n        'calendar' => 'calendar',\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","summary":"Update calendar sharing."}}},"tags":[{"name":"CPDAVD","description":"The CPDAVD module for UAPI."},{"description":"Optional Applications / Calendar and Contacts (DAV)","name":"Calendar and Contacts (DAV)"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.119.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}}},"DirectoryIndexes":{"get_indexing":{"x-tagGroups":[{"tags":["Directory Indexes"],"name":"Directory Management"}],"paths":{"/DirectoryIndexes/get_indexing":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryIndexes \\\n  get_indexing \\\n  dir='/home/example/example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryIndexes/get_indexing?dir=%2fhome%2fexample%2fexample.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryIndexes_get_indexing.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryIndexes_get_indexing.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/DirectoryIndexes/,\n    q/get_indexing/,\n    {\n        'dir' => '/home/example/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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryIndexes_get_indexing.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryIndexes_get_indexing.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    'DirectoryIndexes',\n    'get_indexing',\n    array (\n        'dir' => '/home/example/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}"}],"tags":["DirectoryIndexes","Directory Indexes"],"summary":"Return directory indexing settings","x-cpanel-api-version":"UAPI","parameters":[{"required":"true","name":"dir","in":"query","schema":{"type":"string","example":"/home/example/example.com"},"description":"The directory for which to check the indexing type."}],"description":"This function returns the directory indexing settings for a directory on the cPanel account and its subdirectories.","operationId":"get_indexing","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"string","description":"The directory's indexing type.\n- standard  The directory uses directory indexing with standard formatting.\n- disabled  The directory doesn't use directory indexing.\n- inherit  The directory uses the system's default settings.\n- fancy  The directory uses directory indexing with Apache FancyIndexing directive. The directory will include additional information such as file size and the date of the file's last update.","example":"disabled"}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"DirectoryIndexes","description":"The name of the module called."},"func":{"type":"string","example":"get_indexing","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 88"}}},"tags":[{"name":"DirectoryIndexes","description":"The DirectoryIndexes module for UAPI."},{"description":"Directory Management / Directory Indexes","name":"Directory Indexes"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"openapi":"3.0.2"},"set_indexing":{"tags":[{"name":"DirectoryIndexes","description":"The DirectoryIndexes module for UAPI."},{"description":"Directory Management / Directory Indexes","name":"Directory Indexes"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Directory Indexes"],"name":"Directory Management"}],"paths":{"/DirectoryIndexes/set_indexing":{"get":{"summary":"Update directory indexing settings","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryIndexes \\\n  set_indexing \\\n  dir='/home/example/example.com' \\\n  type='inherit'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryIndexes/set_indexing?dir=%2fhome%2fexample%2fexample.com&type=inherit"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryIndexes_set_indexing.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryIndexes_set_indexing.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/DirectoryIndexes/,\n    q/set_indexing/,\n    {\n        'dir' => '/home/example/example.com',\n        'type' => 'inherit',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryIndexes_set_indexing.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryIndexes_set_indexing.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    'DirectoryIndexes',\n    'set_indexing',\n    array (\n        'dir' => '/home/example/example.com',\n        'type' => 'inherit',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["DirectoryIndexes","Directory Indexes"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"DirectoryIndexes","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"data":{"type":"string","description":"The directory's indexing type.\n* `standard` — The directory uses directory indexing with standard formatting.\n* `disabled` — The directory doesn't use directory indexing.\n* `inherit` — The directory uses the system's default settings.\n* `fancy` — The directory uses directory indexing with Apache FancyIndexing directive. The directory will include additional information such as file size and the date of the file's last update.","enum":["standard","disabled","inherit","fancy"],"example":"disabled"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* 1 — Success.\n* 0 — Failed. Check the `errors` field for more details."},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"description":"The name of the method called.","example":"set_indexing","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 88","parameters":[{"required":"true","name":"dir","in":"query","schema":{"format":"path","example":"/home/example/example.com","type":"string"},"description":"The directory for which to manage directory indexing."},{"description":"The type of directory indexing.\n\n* `standard` — The directory uses directory indexing with standard formatting.\n* `disabled` — The directory doesn't use directory indexing.\n* `inherit` — The directory uses the system's default settings.\n* `fancy` — The directory uses directory indexing with Apache FancyIndexing directive. The directory will include additional information such as file size and the date of the file's last update.","schema":{"example":"inherit","enum":["standard","disabled","inherit","fancy"],"type":"string"},"name":"type","in":"query","required":"true"}],"operationId":"set_indexing","description":"This function configures the [directory indexing](https://go.cpanel.net/cpaneldocsIndexes) settings for a directory on the cPanel account."}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"list_directories":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{"index_type":{"example":"inherit","enum":["standard","disabled","inherit","fancy"],"description":"The directory's indexing type.\n\n* `standard` - The directory uses directory indexing with standard formatting.\n* `disabled` - The directory doesn't use directory indexing.\n* `inherit` - The directory uses the system's default settings.\n* `fancy` - The directory uses directory indexing with Apache® `httpd`’s `FancyIndexing` directive. The directory will include additional information such as file size and the date of the file's last update.","type":"string"}},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/DirectoryIndexes/list_directories":{"get":{"parameters":[{"required":"true","in":"query","name":"dir","schema":{"example":"/home/example/example.com","format":"path","type":"string"},"description":"The absolute path of the directory for which to return indexing information."}],"operationId":"DirectoryIndexes-list_directories","description":"This function returns the [directory indexing](https://go.cpanel.net/cpaneldocsIndexes) settings of the subdirectories in a directory.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"DirectoryIndexes","description":"The name of the module called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"data":{"properties":{"current":{"properties":{"state":{"description":"The current directory's indexing information.","type":"object","properties":{"index_type":{"$ref":"#/components/schemas/index_type"}}},"path":{"example":"/home/example/example.com","description":"The current directory's absolute path.","format":"path","type":"string"}},"type":"object","description":"The user's current directory and its indexing information."},"home":{"description":"The user's home directory and its indexing information.","properties":{"path":{"type":"string","description":"The home directory's absolute path.","format":"path","example":"/home/example"},"state":{"properties":{"index_type":{"$ref":"#/components/schemas/index_type"}},"type":"object","description":"An object containing the home directory's indexing information."}},"type":"object"},"children":{"items":{"properties":{"state":{"type":"object","properties":{"index_type":{"$ref":"#/components/schemas/index_type"}},"description":"The subdirectory's indexing information."},"path":{"type":"string","example":"/home/example/example.com/cgi-bin","description":"The subdirectory's absolute path.","format":"path"}},"type":"object"},"description":"Subdirectories and their indexing information.\n\n**Note:**\n\nThe function returns an object for each subdirectory in a directory.","type":"array"},"parent":{"properties":{"state":{"description":"The parent directory's indexing information.","type":"object","properties":{"index_type":{"$ref":"#/components/schemas/index_type"}}},"path":{"example":"/home/example","description":"The parent directory's absolute path.","format":"path","type":"string"}},"type":"object","description":"The current directory’s parent directory and its indexing information."}},"type":"object"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"}}},"func":{"type":"string","description":"The name of the method called.","example":"list_directories"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 88","tags":["DirectoryIndexes","Directory Indexes"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DirectoryIndexes \\\n  list_directories \\\n  dir='/home/example/example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DirectoryIndexes/list_directories?dir=%2fhome%2fexample%2fexample.com","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DirectoryIndexes_list_directories.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DirectoryIndexes_list_directories.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/DirectoryIndexes/,\n    q/list_directories/,\n    {\n        'dir' => '/home/example/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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DirectoryIndexes_list_directories.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DirectoryIndexes_list_directories.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    'DirectoryIndexes',\n    'list_directories',\n    array (\n        'dir' => '/home/example/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}"}],"x-cpanel-api-version":"UAPI","summary":"Return subdirectories directory indexing settings"}}},"x-tagGroups":[{"name":"Directory Management","tags":["Directory Indexes"]}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"DirectoryIndexes","description":"The DirectoryIndexes module for UAPI."},{"name":"Directory Indexes","description":"Directory Management / Directory Indexes"}]}},"Bandwidth":{"query":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"Bandwidth","description":"The Bandwidth module for UAPI."}],"paths":{"/Bandwidth/query":{"get":{"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"description":"An object containing any additional data returned by the API.","additionalProperties":{"type":"object","nullable":"true"}},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"data":{"type":"object","additionalProperties":{"description":"This object's keys are the values of the first grouping parameter.","type":"object","x-additionalPropertiesName":"grouping-param-value-1","additionalProperties":{"nullable":"true","description":"This object's keys are the values of the second grouping parameter.","type":"object","additionalProperties":{"nullable":"true","description":"This object's keys are the values of the third grouping parameter.","type":"object","x-additionalPropertiesName":"grouping-param-value-3"},"x-additionalPropertiesName":"grouping-param-value-2"}},"description":"The function returns data in a hierarchy of objects that the order of values in the `grouping` parameter determines.\n\nFor example:\n\n* `domain` - Returns data by domain.\n* `domain|protocol` - Returns data by protocol and nests it within the object for each domain.\n* `domain|year` - Returns data by year and nests it within the object for each domain.\n* `year|domain` - Returns data by domain and nests it within object for each year.\n* `domain|year|protocol` - Returns data by protocol and nests it within object for each year, which the result then nests in objects for each domain.\n\nThe deepest child object contains the bandwidth data in bytes.\n"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API."}},"type":"object"},"module":{"type":"string","example":"Bandwidth","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"query"}}},"examples":{"domain_year":{"description":"grouping=domain|year","value":{"data":{"example.com":{"1325376000":"27496678808","1388534400":"17664354048","1356998400":"16961550301","1420070400":"26169989838"},"parkedexample.com":{"1325376000":"2474092283","1388534400":"1514221571","1356998400":"1214392","1420070400":"14871594368"},"subdomain.example.com":{"1420070400":"4519","1356998400":"1180","1388534400":"5708"},"UNKNOWN":{"1325376000":"141799","1420070400":"3737236","1356998400":"52558","1388534400":"56450"},"subdomain2.example.com":{"1420070400":"683533"}},"status":"1","errors":null,"metadata":{},"messages":null}},"domain":{"value":{"messages":null,"data":{"UNKNOWN":"70447164","subdomain.example.com":"11407","subdomain2.example.com":"683533","example.com":"815258916235","parkedexample.com":"18861122614"},"status":"1","errors":null,"metadata":{}},"description":"grouping=domain"},"year_domain":{"description":"grouping=year|domain","value":{"messages":null,"status":"1","errors":null,"data":{"1356998400":{"UNKNOWN":"70447164","subdomain.example.com":"11407","subdomain2.example.com":"683533","example.com":"815258916235","parkedexample.com":"18861122614"},"1388534400":{"subdomain2.example.com":"683533","UNKNOWN":"70447164","subdomain.example.com":"11407","parkedexample.com":"18861122614","example.com":"815258916235"},"1420070400":{"parkedexample.com":"18861122614","example.com":"815258916235","subdomain2.example.com":"683533","UNKNOWN":"70447164","subdomain.example.com":"11407"},"1325376000":{"parkedexample.com":"18861122614","example.com":"815258916235","subdomain2.example.com":"683533","subdomain.example.com":"11407","UNKNOWN":"70447164"}},"metadata":{}}},"domain_protocol_year":{"description":"grouping=domain|protocol|year","value":{"messages":null,"status":"1","errors":null,"data":{"subdomain2.example.com":{"http":{"1420070400":"683533"}},"subdomain.example.com":{"http":{"1420070400":"1180","1388534400":"10227"}},"UNKNOWN":{"imap":{"1325376000":"11036.0461226852","1420070400":"39745","1388534400":"5148","1356998400":"14892"},"smtp":{"1388534400":"37310742","1356998400":"2525944.05255787","1420070400":"30384052","1325376000":"155605"}},"parkedexample.com":{"http":{"1356998400":"1214392","1420070400":"18859908222"}},"example.com":{"http":{"1388534400":"330435334428","1356998400":"252262219725","1420070400":"220860690076","1325376000":"11700672006"}}},"metadata":{}}}}}},"description":"HTTP Request was successful."}},"operationId":"query","description":"This function queries an account's bandwidth data and returns a report.\n\n**Note:**\n\nThis function also returns the bandwidth use of a [distributed cPanel account](https://go.cpanel.net/cPanelGlossary#distributed-cpanel-account).","parameters":[{"schema":{"anyOf":[{"type":"string","enum":["domain","protocol"]},{"type":"string","enum":["year","year_month","year_month_day","year_month_day_hour","year_month_day_hour_minute"]}]},"explode":"false","examples":{"domain_protocol_year":{"summary":"domain|protocol|year","value":"grouping=domain|protocol|year"},"protocol_year_month":{"summary":"protocol|year_month","value":"grouping=protocol|year_month"},"year_month_day":{"value":"grouping=year_month_day","summary":"year_month_day"},"domain_year":{"value":"grouping=domain|year","summary":"domain|year"}},"style":"pipeDelimited","description":"How to group the data in the report, in pipe-separated format. This list **must** contain one or both of the following parameters:\n\nA pipe-separated list that contains one or both of the following parameters:\n* `domain`\n* `protocol`\n\nThis parameter can also include only **one** of the following start time interval types:\n* `year`\n* `year_month`\n* `year_month_day`\n* `year_month_day_hour`\n* `year_month_day_mour_minute`\n\n**Note:**\n\n* This parameter accepts a maximum of three values.\n* The function nests the return objects in the order that you declare the values in this parameter.","required":"true","name":"grouping","in":"query"},{"description":"Length of time between bandwidth data samples.\n\n* `daily`\n* `hourly`\n* `5min`\n\n**Note:**\n\nThe interval's retention period determines availability of the interval's data.\nUse the `Bandwidth::get_retention_periods` API to determine an interval's retention period.","schema":{"example":"daily","enum":["daily","hourly","5min"],"default":"daily","type":"string"},"in":"query","name":"interval","required":"false"},{"examples":{"single":{"summary":"Get data for a specific domain.","value":"example.com"},"multiple":{"summary":"Get data for multiple domains and UNKNOWN.","value":"domains=example.com|subdomain.example.com|subdomain2.example.com|parkedexample.com|UNKNOWN"}},"explode":"false","schema":{"type":"string","format":"domain"},"name":"domains","in":"query","required":"false","style":"pipeDelimited","description":"A pipe-separated list of domains for which to provided data.\n\n**Note:**\n\n* If you do not include this parameter, the function will return data for all domains on the cPanel account.\n* The `UNKNOWN` \"pseudo-domain\" refers to data recorded without a specific domain. All traffic except HTTP traffic\nis recorded without a specific domain."},{"schema":{"type":"string"},"explode":"false","examples":{"multiple":{"value":"protocols=http|imap|smtp|pop3|ftp","summary":"Get data for multiple protocols."},"single":{"summary":"Get data for a specific protocol.","value":"http"}},"required":"false","in":"query","name":"protocols","description":"A pipe-separated list of the protocols for which to provide data.\n* `http`\n* `imap`\n* `smtp`\n* `pop3`\n* `ftp`","style":"pipeDelimited"},{"description":"The start date of the report window.","schema":{"format":"unix_timestamp","example":"1445664609","type":"integer"},"name":"start","in":"query","required":"false"},{"schema":{"type":"integer","example":"1446664809","format":"unix_timestamp"},"description":"The end date of the report window.","required":"false","name":"end","in":"query"},{"required":"false","name":"timezone","in":"query","schema":{"format":"olson_timezone_name","example":"America/Chicago","type":"string"},"description":"The timezone in which to report the data."}],"summary":"Return cPanel account's bandwidth usage report","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Bandwidth \\\n  query \\\n  grouping='domain|protocol|year'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Bandwidth/query?grouping=grouping%3ddomain%7cprotocol%7cyear","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Bandwidth_query.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Bandwidth_query.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/Bandwidth/,\n    q/query/,\n    {\n        'grouping' => 'grouping=domain|protocol|year',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Bandwidth_query.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Bandwidth_query.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    'Bandwidth',\n    'query',\n    array (\n        'grouping' => 'grouping=domain|protocol|year',\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}"}],"tags":["Bandwidth"]}}},"x-tagGroups":[{"tags":["Bandwidth"],"name":"Retrieve bandwidth information"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"get_retention_periods":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"description":"The Bandwidth module for UAPI.","name":"Bandwidth"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"name":"Retrieve bandwidth information","tags":["Bandwidth"]}],"paths":{"/Bandwidth/get_retention_periods":{"get":{"parameters":[],"operationId":"get_retention_periods","description":"This function retrieves the retention periods for bandwidth data.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"Bandwidth","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"type":"array","items":{"properties":{"interval":{"type":"string","example":"5min","enum":["daily","hourly","5min"],"description":"The interval in which the system reports bandwidth data.\n- `daily`\n- `hourly`\n- `5min`"},"retention":{"description":"The retention period for bandwidth data.","format":"unix_timestamp","example":"2678400","type":"integer"}},"type":"object"}},"status":{"enum":["0","1"],"example":"1","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"}},"type":"object"},"func":{"description":"The name of the method called.","example":"get_retention_periods","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.52","tags":["Bandwidth"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Bandwidth \\\n  get_retention_periods\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Bandwidth/get_retention_periods"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Bandwidth_get_retention_periods.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Bandwidth_get_retention_periods.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/Bandwidth/,\n    q/get_retention_periods/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Bandwidth_get_retention_periods.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Bandwidth_get_retention_periods.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    'Bandwidth',\n    'get_retention_periods'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return bandwidth retention period"}}}},"get_enabled_protocols":{"x-tagGroups":[{"name":"Retrieve bandwidth information","tags":["Bandwidth"]}],"paths":{"/Bandwidth/get_enabled_protocols":{"get":{"tags":["Bandwidth"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Bandwidth \\\n  get_enabled_protocols\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Bandwidth/get_enabled_protocols","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Bandwidth_get_enabled_protocols.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Bandwidth_get_enabled_protocols.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/Bandwidth/,\n    q/get_enabled_protocols/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Bandwidth_get_enabled_protocols.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Bandwidth_get_enabled_protocols.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    'Bandwidth',\n    'get_enabled_protocols'\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","summary":"Return services monitored in bandwidth data","parameters":[],"description":"This function returns a list of the server's enabled protocols.","operationId":"get_enabled_protocols","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"get_enabled_protocols","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string","enum":["ftp","http","imap","pop3","smtp"],"example":"imap"},"description":"The bandwidth protocols that the server records.\n* `ftp`\n* `imap`\n* `pop3`\n* `smtp`\n* `http` — This value includes all web traffic for the 80 and 443 ports."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{}},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"Bandwidth","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 76"}}},"tags":[{"name":"Bandwidth","description":"The Bandwidth module for UAPI."}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}}},"Themes":{"get_theme_base":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The Themes module for UAPI.","name":"Themes"},{"description":"cPanel Theme Management / Theme Settings","name":"Theme Settings"}],"paths":{"/Themes/get_theme_base":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Themes \\\n  get_theme_base\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Themes/get_theme_base"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Themes_get_theme_base.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Themes_get_theme_base.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/Themes/,\n    q/get_theme_base/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Themes_get_theme_base.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Themes_get_theme_base.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    'Themes',\n    'get_theme_base'\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}","lang":"PHP","label":"LiveAPI PHP"}],"deprecated":"true","tags":["Themes","Theme Settings"],"summary":"Return current theme","x-cpanel-api-version":"UAPI","description":"This function is deprecated and does not return useful output.","operationId":"get_theme_base","parameters":[],"x-cpanel-available-version":"cPanel 11.50","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"get_theme_base","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"Themes"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"data":{"type":"string","description":"The cPanel account's base theme. The function returns **only** one of the following strings:\n* `jupiter`\n* `unknown` — The function returns this value when it cannot determine the base theme that\nyou modified to create the custom theme.","enum":["jupiter","unknown"],"example":"jupiter"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"}}}}}}}}}}}},"x-tagGroups":[{"name":"cPanel Theme Management","tags":["Theme Settings"]}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"update":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"description":"The Themes module for UAPI.","name":"Themes"},{"name":"Theme Settings","description":"cPanel Theme Management / Theme Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Theme Settings"],"name":"cPanel Theme Management"}],"paths":{"/Themes/update":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update current theme","tags":["Themes","Theme Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Themes \\\n  update \\\n  theme='jupiter'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Themes/update?theme=jupiter","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Themes_update.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Themes_update.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/Themes/,\n    q/update/,\n    {\n        'theme' => 'jupiter',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Themes_update.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Themes_update.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    'Themes',\n    'update',\n    array (\n        'theme' => 'jupiter',\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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"metadata":{"properties":{}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the theme changed.\n\n* `1` — The theme changed.\n* `0` — The theme did **not** change, or the function failed.\n\n**Note:**\n\nIf the function fails, check the `errors` field for more details."},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"type":"object","nullable":"true"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Themes"},"func":{"description":"The name of the method called.","example":"update","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"in":"query","name":"theme","required":"true","description":"The theme name.","schema":{"example":"jupiter","type":"string"}}],"description":"This function applies a new theme to the cPanel interface.\n\n**Note:**\n\n  The `/usr/local/cpanel/scripts/modify_accounts` script allows you to modify the theme for many or all accounts on the server. For more information, read our [The modify_accounts Script](https://go.cpanel.net/modifyaccounts) documentation.","operationId":"Themes::update"}}}},"list":{"paths":{"/Themes/list":{"get":{"summary":"Return available themes","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Themes \\\n  list\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Themes/list","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Themes_list.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Themes_list.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/Themes/,\n    q/list/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Themes_list.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Themes_list.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    'Themes',\n    'list'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Themes","Theme Settings"],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"list"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"data":{"description":"An array that contains the account's themes.","items":{"example":"jupiter","type":"string"},"type":"array"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Themes","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"Themes::list","description":"This function lists available themes.\n\n**Note:**\n\n  The `/usr/local/cpanel/scripts/modify_accounts` script allows you to modify the style and theme for many or all accounts on the server. For more information, read our [The modify_accounts Script](https://go.cpanel.net/modifyaccounts) documentation.","parameters":[{"name":"show_mail_themes","in":"query","required":"false","description":"Whether to list the account's mail themes.\n* `1` — List mail themes.\n* `0` — Do **not** list mail themes.","schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"}}]}}},"x-tagGroups":[{"tags":["Theme Settings"],"name":"cPanel Theme Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"name":"Themes","description":"The Themes module for UAPI."},{"name":"Theme Settings","description":"cPanel Theme Management / Theme Settings"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"}},"Chkservd":{"get_exim_ports_ssl":{"paths":{"/Chkservd/get_exim_ports_ssl":{"get":{"x-cpanel-available-version":"cPanel 11.42","summary":"Return outgoing mail (SMTP) SSL-secured port","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- `1` - Success\n- `0` - Failed. Check the `errors` field for more details."},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"properties":{"ports":{"items":{"example":"465","minimum":"0","maximum":"65535","type":"integer"},"description":"An array of port numbers on which Exim listens for SSL/TLS connections.","type":"array"}},"type":"object"},"metadata":{"properties":{}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","example":"Chkservd","description":"The name of the module called."},"func":{"example":"get_exim_ports_ssl","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-api-version":"UAPI","description":"This function retrieves Exim's SSL port.","operationId":"get_exim_ports_ssl","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Chkservd \\\n  get_exim_ports_ssl\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Chkservd/get_exim_ports_ssl","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Chkservd_get_exim_ports_ssl.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Chkservd_get_exim_ports_ssl.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/Chkservd/,\n    q/get_exim_ports_ssl/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Chkservd_get_exim_ports_ssl.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Chkservd_get_exim_ports_ssl.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    'Chkservd',\n    'get_exim_ports_ssl'\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}"}],"tags":["Chkservd","Mail Server Information"]}}},"x-tagGroups":[{"tags":["Mail Server Information"],"name":"Email"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Chkservd module for UAPI.","name":"Chkservd"},{"description":"Email / Mail Server Information","name":"Mail Server Information"}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"get_exim_ports":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"tags":[{"description":"The Chkservd module for UAPI.","name":"Chkservd"},{"description":"Email / Mail Server Information","name":"Mail Server Information"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Mail Server Information"],"name":"Email"}],"paths":{"/Chkservd/get_exim_ports":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Chkservd \\\n  get_exim_ports\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Chkservd/get_exim_ports","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Chkservd_get_exim_ports.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Chkservd_get_exim_ports.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/Chkservd/,\n    q/get_exim_ports/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Chkservd_get_exim_ports.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Chkservd_get_exim_ports.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    'Chkservd',\n    'get_exim_ports'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Chkservd","Mail Server Information"],"summary":"Return outgoing (SMTP) mail port","x-cpanel-api-version":"UAPI","parameters":[],"operationId":"get_exim_ports","description":"This function lists the ports on which Exim listens.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"get_exim_ports","description":"The name of the method called.","type":"string"},"module":{"example":"Chkservd","description":"The name of the module called.","type":"string"},"result":{"properties":{"data":{"properties":{"ports":{"uniqueItems":"true","type":"array","description":"An array of port numbers on which Exim listens.","items":{"example":"25","minimum":"1","maximum":"65535","type":"integer"}}},"type":"object"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}}}},"DCV":{"check_domains_via_http":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The DCV module for UAPI.","name":"DCV"},{"description":"SSL Certificates / Verify Domain Ownership","name":"Verify Domain Ownership"}],"paths":{"/DCV/check_domains_via_http":{"get":{"parameters":[{"schema":{"type":"string","format":"domain"},"examples":{"multiple":{"value":"domain-1=example.com&domain-2=example2.com&domain-3=example2.com","summary":"Check multiple domains."},"single":{"value":"example.com","summary":"Check a single domain."}},"description":"The domains to check.\n\n**Note:**\n\nTo check more than one domain, repeat or increment the parameter name. For\nexample, `domain-1`, `domain-2`, and `domain-3`.","required":"true","in":"query","name":"domain"},{"name":"dcv_file_allowed_characters","in":"query","required":"false","description":"An array of characters that the certificate provider allows in the DCV check file's filename.","schema":{"type":"array","default":["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"],"items":{"type":"string"}}},{"name":"dcv_file_random_character_count","in":"query","required":"false","description":"The number of characters that the certificate provider allows in the DCV check file's filename.","schema":{"type":"integer","minimum":"1","default":"100","example":"32"}},{"description":"The DCV check file extension that the certificate provider requires.","schema":{"type":"string","example":"txt","default":""},"name":"dcv_file_extension","in":"query","required":"false"},{"schema":{"type":"string","default":".well-known/pki-validation","example":".well-known/pki-validation"},"description":"The DCV check file's file path, relative to the domain's document `root` directory.","required":"false","name":"dcv_file_relative_path","in":"query"},{"name":"dcv_user_agent_string","in":"query","required":"false","description":"The [user agent string](https://wikipedia.org/wiki/User_agent) that the system uses for the imitated local DCV check.\n\n**Important:**\n\nThe default value can change at any time.","schema":{"example":"SECTIGO+DCV","type":"string"}},{"schema":{"example":"2","default":null,"nullable":"true","minimum":"0","type":"integer"},"description":"The number of domain redirects the system permits the DCV check to follow. The function checks the provider's supported number of redirects.\nIt will then return the `redirect` array of objects for the passed value, plus one. This ensures the function will display any redirects causing DCV failures, if any exist.\n\n**Note:**\n\n* If you pass a `0` value, this function does **not** limit the number of redirect returns.\n* Use the `Market::get_provider_specific_dcv_constraints` UAPI function to list a provider's supported number of redirects.","required":"false","in":"query","name":"dcv_max_redirects"}],"operationId":"check_domains_via_http","description":"This function checks whether the account's domains can pass Domain Control Validation (DCV) via an HTTP request.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"DCV"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"data":{"type":"array","description":"An array of objects that contains results from each domain's DCV check.\n\n**Note:**\n\n The function returns the domain's results in the same order that you pass them in the `domain` parameter.","items":{"type":"object","properties":{"redirects_count":{"example":"0","description":"The number of HTTP redirects that the DCV check follows.","minimum":"0","type":"integer"},"failure_reason":{"type":"string","nullable":"true","example":"The system queried for a temporary file at http://example.com/.well-known/pki-validationD01511F4E E535A5442FC378AA946CF41.txt, but the web server responded with the following error: 404 (Not Found). A DNS (Domain Name System) or web server misconfiguration may exist. The domain example.com resolved to an IP address 93.184.216.34 that does not exist on this server.","description":"The reason that the DCV check failed.\n* `null` — The domain passed the DCV check."},"redirects":{"items":{"type":"object","properties":{"status":{"type":"integer","description":"The [HTTP response status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes).","example":"301"},"redirects":{"nullable":"true","example":null,"description":"An array of objects containing the redirects, if the value exists.","type":"array"},"headers":{"type":"object","description":"An object that contains the [HTTP::Tiny](http://search.cpan.org/~dagolden/HTTP-Tiny-0.070/lib/HTTP/Tiny.pm) CPAN module returns.\n\n**Note:**\n\n  This object's contents vary according to the URL's headers."},"protocol":{"type":"string","example":"HTTP/1.1","description":"The URL's HTTP protocol."},"content":{"type":"string","example":"<!DOCTYPE HTML PUBLIC \\\"-//IETF//DTD HTML 2.0//EN\\\">\\n<html><head>\\n<title>301 Moved Permanently</title>\\n </head><body>\\n<h1>Moved Permanently</h1>\\n <p>The document has moved <a href=\\\"http://www.example.com/.well-known/pki-validation/770102 17B0CCF0CCF6211602F9A1B2B2.txt\\\">here</a>.</p>\\n</body></html>\\n","description":"A message that explains why the function failed."},"reason":{"type":"string","example":"Moved Permanently","description":"The HTTP response status message."},"url":{"example":"http://example.com/.well-known/pki-validation/77010217B0CCF0CCF6211602F9A1B2B2.txt","description":"The URL that the function searches for the DCV file.","format":"url","type":"string"},"success":{"example":"","description":"Whether the server returns a [2XX HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success).\n* `1` — The server returns a 2XX status code.\n* `0` or an empty string — The server does **not** return a 2XX status code.","oneOf":[{"enum":[""],"type":"string"},{"type":"integer","enum":["0","1"]}]}}},"description":"An array of objects that contains DCV check redirect information.\n\n**Note:**\n\n This **only** contains data if the `redirects_count` return includes a value greater than zero.","type":"array"}}}},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null}}},"func":{"type":"string","description":"The name of the method called.","example":"check_domains_via_http"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 60","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DCV \\\n  check_domains_via_http \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DCV/check_domains_via_http?domain=example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DCV_check_domains_via_http.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DCV_check_domains_via_http.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/DCV/,\n    q/check_domains_via_http/,\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    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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DCV_check_domains_via_http.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DCV_check_domains_via_http.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    'DCV',\n    'check_domains_via_http',\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    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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["DCV","Verify Domain Ownership"],"summary":"Verify domain ownership via HTTP","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Verify Domain Ownership"],"name":"SSL Certificates"}]},"ensure_domains_can_pass_dcv":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"x-tagGroups":[{"name":"SSL Certificates","tags":["Verify Domain Ownership"]}],"paths":{"/DCV/ensure_domains_can_pass_dcv":{"get":{"description":"This function indicates whether the account's domains can pass a Domain Control\nValidation (DCV) check.\n\n**Warning:**\n\nWe deprecated this function. Use UAPI's `DCV::check_domains_via_http` function.","operationId":"ensure_domains_can_pass_dcv","parameters":[{"required":"true","name":"domain","in":"query","schema":{"type":"string"},"description":"The domains to check.\n\n**Note:**\n\n To check multiple domains, duplicate or increment the parameter name. For example,\n `domain-1`, `domain-2`, and `domain-3`.","examples":{"single":{"value":"example.com","summary":"Check a single domain."},"multiple-alternative":{"summary":"Check multiple domains.","value":"domain=example1.com domain=example2.com domain=example3.com"},"multiple":{"value":"domain-1=example1.com domain-2=example2.com domain-3=example3.com","summary":"Check multiple domains."}}}],"x-cpanel-available-version":"cPanel 56","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"items":{"nullable":"true","type":"string"},"description":"A list of results from each domain parameter's DCV check.\n\n* `null` — The domain passes the DCV check.\n\n**Note:**\n\nThe function returns the results from the domains in the same order\nin which you called them.","example":[null,null,"The domain resolves to Mars. Beep beep beep."],"type":"array"},"status":{"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"DCV","description":"The name of the module called.","type":"string"},"func":{"example":"ensure_domains_can_pass_dcv","description":"The name of the method called.","type":"string"}}}}}}},"deprecated":"true","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DCV \\\n  ensure_domains_can_pass_dcv \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/DCV/ensure_domains_can_pass_dcv?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DCV_ensure_domains_can_pass_dcv.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DCV_ensure_domains_can_pass_dcv.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/DCV/,\n    q/ensure_domains_can_pass_dcv/,\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    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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DCV_ensure_domains_can_pass_dcv.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DCV_ensure_domains_can_pass_dcv.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    'DCV',\n    'ensure_domains_can_pass_dcv',\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    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}"}],"tags":["DCV","Verify Domain Ownership"],"summary":"Verify domain ownership","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The DCV module for UAPI.","name":"DCV"},{"description":"SSL Certificates / Verify Domain Ownership","name":"Verify Domain Ownership"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}]},"check_domains_via_dns":{"paths":{"/DCV/check_domains_via_dns":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"DCV","description":"The name of the module called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"type":"array","description":"An array of objects containing the results from each `domain` parameter’s DCV check.\n\n**Note:**\n\n The function returns the results from the `domain` parameter in the same order in which you called them.","items":{"type":"object","properties":{"succeeded":{"example":"1","enum":["1","0"],"description":"Whether the DCV check succeeded.\n- `1` - At least one of the `query_results` values equals the `dcv_string` value.\n- `0` - None of the `query_results` values equal the `dcv_string` value.","type":"integer"},"failure_reason":{"example":"The DNS query to _dcv-test-record.example2.org for the DCV challenge returned no TXT record that matches the value _dcv-test-record=wRUFPTN1DskKDG8KHfYM_5cQF5QUGWq1_A2ovO8rKsrIYO_HilAjsQABFCrbJkLX.","description":"A message that contains the reason why the DCV check failed.\n\n**Note:**\n\n  If the server fails to update the DNS zone, the system returns this value.","type":"string"},"zone":{"type":"string","description":"The altered and queried DNS zone name.","format":"domain","example":"example.com"},"domain":{"example":"example.com","description":"The domain that the system verified.","format":"domain","type":"string"},"query_results":{"type":"array","items":{"type":"string"},"description":"The strings that the DNS query returned. This array may be empty.\n\n**Note:**\n\n If the server fails to update the DNS zone, the system returns the `failure_reason` value.","example":["_dcv-test-record=wsWRlG9IsG7KNnLdIsx9Oz2oTw8m5q0imRR9L6LnDBz14sZelvDHqrJyJc6LA0DY"]},"dcv_string":{"type":"string","description":"The expected value of the queried DNS record.","example":"_dcv-test-record=wsWRlG9IsG7KNnLdIsx9Oz2oTw8m5q0imRR9L6LnDBz14sZelvDHqrJyJc6LA0DY"}}}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"func":{"type":"string","description":"The name of the method called.","example":"check_domains_via_dns"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 74","parameters":[{"schema":{"example":"example.com","format":"domain","type":"string"},"description":"The domain or domains to check.\n\n**Note:**\n\n To check multiple domains, increment the parameter name. For example, `domain-0`, `domain-1`, and `domain-2`.","examples":{"single":{"value":"example.com","summary":"Check a single domain."},"multiple":{"value":"domain-0=example.com&domain-1=example2.com","summary":"Check multiple domains."}},"required":"true","name":"domain","in":"query"}],"operationId":"check_domains_via_dns","description":"This function checks whether the account's domains can pass Domain Control Validation (DCV) via a DNS request.","x-cpanel-api-version":"UAPI","summary":"Verify domain ownership via DNS","tags":["DCV","Verify Domain Ownership"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  DCV \\\n  check_domains_via_dns \\\n  domain='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/DCV/check_domains_via_dns?domain=example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file DCV_check_domains_via_dns.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/DCV_check_domains_via_dns.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/DCV/,\n    q/check_domains_via_dns/,\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    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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file DCV_check_domains_via_dns.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/DCV_check_domains_via_dns.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    'DCV',\n    'check_domains_via_dns',\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    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-tagGroups":[{"tags":["Verify Domain Ownership"],"name":"SSL Certificates"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The DCV module for UAPI.","name":"DCV"},{"name":"Verify Domain Ownership","description":"SSL Certificates / Verify Domain Ownership"}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}},"ServiceProxy":{"set_service_proxy_backends":{"tags":[{"description":"The ServiceProxy module for UAPI.","name":"ServiceProxy"},{"description":"Service Proxy","name":"Service Proxy"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"ServiceProxy","tags":["ServiceProxy"]}],"paths":{"/ServiceProxy/set_service_proxy_backends":{"get":{"parameters":[{"schema":{"anyOf":[{"example":"hostname.example.com","format":"hostname","description":"A valid hostname.","type":"string"},{"type":"string","example":"192.0.2.102","format":"ipv4","description":"A valid IP address."}]},"description":"The hostname or IP address to assign as the server that handles\nthe account's service proxy requests.\n\nThis parameter defaults to the existing service proxy configuration,\nif one exists.","required":"false","name":"general","in":"query"},{"required":"false","name":"service_group","in":"query","schema":{"enum":["Mail"],"type":"string"},"description":"The name of a service group for which to assign a proxy backend. The\ncorresponding `service_group_backend` value will be the service group's\nnew proxy backend.\n\n* `Mail` — The [Mail service group](https://go.cpanel.net/ServiceProxying#Mail).\n\nThis parameter defaults to the existing setting, if one exists.\n\n**Note:**\n\n * When you call this parameter, you **must** include a corresponding\n `service_group_backend` value.\n * To add multiple `service_group` values, increment the parameter name. For example,\n `service_group`, `service_group-1`, and `service_group-2`.","examples":{"single":{"value":"Mail","summary":"Add a single service backend group."},"multiple":{"summary":"Add multiple service backend groups.","value":"Mail&service-group-1=Mail&service-group-2=Mail"}}},{"schema":{"anyOf":[{"type":"string","example":"hostname.example.com","format":"hostname","description":"A valid hostname."},{"type":"string","example":"192.0.2.102","format":"ipv4","description":"A valid IP address."}]},"description":"The hostname or IP address of the server to assign as the corresponding\n`service_group` value's proxy backend server.\n\nThis parameter defaults to the existing setting, if one exists.\n\n**Note:**\n\n * When you call this parameter, you **must** include a corresponding `service_group`\n value.\n * To add multiple `service_group_backend` values, increment the parameter name.\n For example, `service_group_backend`, `service_group_backend-1`,\n and `service_group_backend-2`.","examples":{"single":{"summary":"Add a single service group backend server.","value":"mail.example.com"},"multiple":{"summary":"Add multiple service group backend servers.","value":"mail.example.com&service_group_backend-1=mail.example1.com&service_group_backend-2=mail.example2.com"}},"required":"false","name":"service_group_backend","in":"query"}],"operationId":"serviceproxy-set_service_proxy_backends","description":"This function lets you configure a cPanel account's\n[service proxying](https://go.cpanel.net/ServiceProxying).\n\n**Note:**\n\n* If the [Web Server](https://go.cpanel.net/howtouseserverprofiles#roles) role is active\non the server, this function rebuilds the user's web virtual hosts (vhosts) and restarts\nthe web server.\n* If the system cannot rebuild the user's vhosts, the API call will still succeed. However,\nthe function returns a failure warning in the metadata.\n* To remove an account's service proxying, use the UAPI `unset_all_service_proxy_backends`\nfunction.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"set_service_proxy_backends","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"object","default":null,"nullable":"true"},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"}}},"module":{"description":"The name of the module called.","example":"ServiceProxy","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 96","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ServiceProxy \\\n  set_service_proxy_backends\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/ServiceProxy/set_service_proxy_backends"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ServiceProxy_set_service_proxy_backends.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/ServiceProxy_set_service_proxy_backends.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/ServiceProxy/,\n    q/set_service_proxy_backends/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ServiceProxy_set_service_proxy_backends.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/ServiceProxy_set_service_proxy_backends.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    'ServiceProxy',\n    'set_service_proxy_backends'\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}"}],"tags":["ServiceProxy"],"summary":"Add cPanel account service proxying","x-cpanel-api-version":"UAPI"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"unset_all_service_proxy_backends":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"description":"The ServiceProxy module for UAPI.","name":"ServiceProxy"},{"name":"Service Proxy","description":"Service Proxy"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["ServiceProxy"],"name":"ServiceProxy"}],"paths":{"/ServiceProxy/unset_all_service_proxy_backends":{"get":{"x-cpanel-api-version":"UAPI","summary":"Remove cPanel account service proxying","tags":["ServiceProxy"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ServiceProxy \\\n  unset_all_service_proxy_backends\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/ServiceProxy/unset_all_service_proxy_backends"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ServiceProxy_unset_all_service_proxy_backends.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/ServiceProxy_unset_all_service_proxy_backends.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/ServiceProxy/,\n    q/unset_all_service_proxy_backends/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ServiceProxy_unset_all_service_proxy_backends.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/ServiceProxy_unset_all_service_proxy_backends.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    'ServiceProxy',\n    'unset_all_service_proxy_backends'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-available-version":"cPanel 96","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"data":{"type":"object","nullable":"true","default":null},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"metadata":{"properties":{}},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}}},"module":{"description":"The name of the module called.","example":"ServiceProxy","type":"string"},"func":{"description":"The name of the method called.","example":"unset_all_service_proxy_backends","type":"string"}},"type":"object"}}}}},"operationId":"serviceproxy-unset_all_service_proxy_backends","description":"This function removes a cPanel account's\n[service proxying](https://go.cpanel.net/ServiceProxying).\n\n**Note:**\n\n* If the [Web Server](https://go.cpanel.net/howtouseserverprofiles#roles) role is active on\nthe server, this function rebuilds the cPanel user's web virtual hosts (vhosts) and restarts\nthe web server.\n* If the system **cannot** rebuild the cPanel user's vhosts, the API call will still succeed.\nHowever, the function returns a failure warning in the metadata.\n* To set a service proxying for a cPanel account, use the UAPI\n`set_service_proxy_backends` function.","parameters":[]}}}},"get_service_proxy_backends":{"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/ServiceProxy/get_service_proxy_backends":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"metadata":{"properties":{}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"description":"The account’s service proxying backends.","items":{"properties":{"service_group":{"example":"Mail","description":"The name of the proxying service group, if applicable.\n\n* null — The account’s general service proxying backend.","nullable":"true","type":"string"},"backend":{"type":"string","format":"domain","description":"The name of the server to which the system will proxy requests for this service group.","example":"example.com"}},"type":"object"},"type":"array"}}},"module":{"type":"string","example":"ServiceProxy","description":"The name of the module called."},"func":{"description":"The name of the method called.","example":"get_service_proxy_backends","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 96","parameters":[],"operationId":"serviceproxy-get_service_proxy_backends","description":"This function reports a cPanel account's\n[service proxying](https://go.cpanel.net/ServiceProxying)\nconfiguration.","x-cpanel-api-version":"UAPI","summary":"Return a cPanel account’s service proxying setup","tags":["ServiceProxy"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ServiceProxy \\\n  get_service_proxy_backends\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ServiceProxy/get_service_proxy_backends","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ServiceProxy_get_service_proxy_backends.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/ServiceProxy_get_service_proxy_backends.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/ServiceProxy/,\n    q/get_service_proxy_backends/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ServiceProxy_get_service_proxy_backends.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/ServiceProxy_get_service_proxy_backends.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    'ServiceProxy',\n    'get_service_proxy_backends'\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-tagGroups":[{"name":"ServiceProxy","tags":["ServiceProxy"]}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"ServiceProxy","description":"The ServiceProxy module for UAPI."},{"name":"Service Proxy","description":"Service Proxy"}]}},"TwoFactorAuth":{"get_team_user_configuration":{"x-tagGroups":[{"name":"Authentication","tags":["Two-Factor Settings"]}],"paths":{"/TwoFactorAuth/get_team_user_configuration":{"get":{"operationId":"get_team_user_configuration","description":"This function retrieves a [team user's](https://go.cpanel.net/manage-team) configuration settings for two-factor authentication.","parameters":[{"in":"query","name":"team_user","required":"true","description":"The team user's username.\n\n**Note:**\n\nThe username will always precede the cPanel account's primary domain.","schema":{"example":"user@example.com","type":"string"}}],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_team_user_configuration","type":"string"},"module":{"example":"TwoFactorAuth","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"type":"object","properties":{"issuer":{"type":"string","example":"Example WebPros International, LLC","description":"The authentication code issuer's name."},"is_enabled":{"description":"Whether two-factor authentication is enabled for the team user.\n* `1` - Enabled.\n* `0` - Disabled.","enum":["0","1"],"example":"1","type":"integer"}}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}}}},"tags":["TwoFactorAuth","Two-Factor Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  TwoFactorAuth \\\n  get_team_user_configuration \\\n  team_user=teamuser\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/TwoFactorAuth/get_team_user_configuration","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file TwoFactorAuth_get_team_user_configuration.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_get_team_user_configuration.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/TwoFactorAuth/,\n    q/get_team_user_configuration/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file TwoFactorAuth_get_team_user_configuration.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_get_team_user_configuration.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    'TwoFactorAuth',\n    'get_team_user_configuration'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return team user 2FA config"}}},"tags":[{"description":"The TwoFactorAuth module for UAPI.","name":"TwoFactorAuth"},{"name":"Two-Factor Settings","description":"Authentication / Two-Factor Settings"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"set_user_configuration":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"tags":[{"name":"TwoFactorAuth","description":"The TwoFactorAuth module for UAPI."},{"description":"Authentication / Two-Factor Settings","name":"Two-Factor Settings"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Authentication","tags":["Two-Factor Settings"]}],"paths":{"/TwoFactorAuth/set_user_configuration":{"get":{"summary":"Save 2FA config","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  TwoFactorAuth \\\n  set_user_configuration \\\n  secret='JBSWY3DPEHPK3PXP' \\\n  tfa_token='528112'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/TwoFactorAuth/set_user_configuration?secret=JBSWY3DPEHPK3PXP&tfa_token=528112","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file TwoFactorAuth_set_user_configuration.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_set_user_configuration.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/TwoFactorAuth/,\n    q/set_user_configuration/,\n    {\n        'secret' => 'JBSWY3DPEHPK3PXP',\n        'tfa_token' => '528112',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file TwoFactorAuth_set_user_configuration.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_set_user_configuration.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    'TwoFactorAuth',\n    'set_user_configuration',\n    array (\n        'secret' => 'JBSWY3DPEHPK3PXP',\n        'tfa_token' => '528112',\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}"}],"tags":["TwoFactorAuth","Two-Factor Settings"],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"tfa_configured":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether two-factor authentication is enabled.\n* `1` - Enabled.\n* `1` - Disabled."}}},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"TwoFactorAuth","type":"string"},"func":{"type":"string","example":"set_user_configuration","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"set_user_configuration","description":"This function configures the two-factor authentication settings for an account.","parameters":[{"description":"The 16-character string that UAPI's `TwoFactorAuth::generate_user_configuration` function generates.","schema":{"example":"JBSWY3DPEHPK3PXP","maxLength":"16","type":"string"},"name":"secret","in":"query","required":"true"},{"schema":{"example":"528112","type":"integer","maxLength":"6"},"description":"The six-digit security code that the time-based one-time password (TOTP) authentication app generates.","required":"true","name":"tfa_token","in":"query"}]}}}},"remove_user_configuration":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"name":"TwoFactorAuth","description":"The TwoFactorAuth module for UAPI."},{"name":"Two-Factor Settings","description":"Authentication / Two-Factor Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"tags":["Two-Factor Settings"],"name":"Authentication"}],"paths":{"/TwoFactorAuth/remove_user_configuration":{"get":{"operationId":"remove_user_configuration","description":"This function removes the user from the two-factor authentication `userdata` file.","parameters":[],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"remove_user_configuration","description":"The name of the method called.","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"data":{"type":"object","properties":{"tfa_removed":{"description":"Whether the system removed the user from the two-factor authentication `userdata` file.\n* `1` - Removed.\n\n**Note:**\n\nIf a removal fails, the system sends a failure response with the reason in the metadata.","enum":["1"],"example":"1","type":"integer"}}},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"}},"type":"object"},"module":{"example":"TwoFactorAuth","description":"The name of the module called.","type":"string"}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  TwoFactorAuth \\\n  remove_user_configuration\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/TwoFactorAuth/remove_user_configuration"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file TwoFactorAuth_remove_user_configuration.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_remove_user_configuration.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/TwoFactorAuth/,\n    q/remove_user_configuration/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file TwoFactorAuth_remove_user_configuration.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_remove_user_configuration.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    'TwoFactorAuth',\n    'remove_user_configuration'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["TwoFactorAuth","Two-Factor Settings"],"summary":"Remove 2FA config","x-cpanel-api-version":"UAPI"}}}},"get_user_configuration":{"tags":[{"description":"The TwoFactorAuth module for UAPI.","name":"TwoFactorAuth"},{"name":"Two-Factor Settings","description":"Authentication / Two-Factor Settings"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"x-tagGroups":[{"name":"Authentication","tags":["Two-Factor Settings"]}],"paths":{"/TwoFactorAuth/get_user_configuration":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return cPanel account 2FA config","tags":["TwoFactorAuth","Two-Factor Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  TwoFactorAuth \\\n  get_user_configuration\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/TwoFactorAuth/get_user_configuration"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file TwoFactorAuth_get_user_configuration.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_get_user_configuration.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/TwoFactorAuth/,\n    q/get_user_configuration/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file TwoFactorAuth_get_user_configuration.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_get_user_configuration.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    'TwoFactorAuth',\n    'get_user_configuration'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"TwoFactorAuth","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"properties":{"is_enabled":{"type":"integer","description":"Whether two-factor authentication is enabled for the account.\n* `1` - Enabled.\n* `0` - Disabled.","enum":["0","1"],"example":"1"},"issuer":{"type":"string","example":"Example WebPros International, LLC","description":"The authentication code issuer's name."}},"type":"object"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"}}},"func":{"description":"The name of the method called.","example":"get_user_configuration","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","parameters":[],"operationId":"get_user_configuration","description":"This function retrieves the cPanel account user's configuration settings for two-factor authentication."}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"generate_user_configuration":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"description":"The TwoFactorAuth module for UAPI.","name":"TwoFactorAuth"},{"description":"Authentication / Two-Factor Settings","name":"Two-Factor Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Two-Factor Settings"],"name":"Authentication"}],"paths":{"/TwoFactorAuth/generate_user_configuration":{"get":{"parameters":[],"operationId":"generate_user_configuration","description":"This function generates an authentication code to enable configuration of two-factor authentication.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"generate_user_configuration","description":"The name of the method called."},"result":{"properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"data":{"properties":{"secret":{"type":"string","example":"S3I4WUY7MTHRMMWN","description":"A generated code for use with two-factor authentication."},"otpauth_str":{"type":"string","description":"A one-time authentication URL to encode as the QR code.","example":"otpauth://totp/Example%20cPanel%20L.L.C.:fakedomain?secret=S3I4WUY7MTHRMMWN&issuer=Example%20cPanel%20L.L.C."}},"type":"object"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"TwoFactorAuth"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 54","tags":["TwoFactorAuth","Two-Factor Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  TwoFactorAuth \\\n  generate_user_configuration\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/TwoFactorAuth/generate_user_configuration"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file TwoFactorAuth_generate_user_configuration.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_generate_user_configuration.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/TwoFactorAuth/,\n    q/generate_user_configuration/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file TwoFactorAuth_generate_user_configuration.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/TwoFactorAuth_generate_user_configuration.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    'TwoFactorAuth',\n    'generate_user_configuration'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Create 2FA authentication code"}}}}},"Stats":{"get_bandwidth":{"tags":[{"name":"Stats","description":"The Stats module for UAPI."},{"description":"Statistics / Domain Statistics","name":"Domain Statistics"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Statistics","tags":["Domain Statistics"]}],"paths":{"/Stats/get_bandwidth":{"get":{"tags":["Stats","Domain Statistics"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Stats \\\n  get_bandwidth\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Stats/get_bandwidth","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Stats_get_bandwidth.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Stats_get_bandwidth.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/Stats/,\n    q/get_bandwidth/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Stats_get_bandwidth.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Stats_get_bandwidth.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    'Stats',\n    'get_bandwidth'\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","summary":"Return bandwidth statistics for all domains","description":"This function retrieves a list of bandwidth records for the domains on a cPanel account.\n\n**Note:**\n\nThis function also returns the bandwidth use of a [distributed cPanel account](https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-glossary#distributed-cpanel-account).\n\n**Warning:**\n\nThis function requires the _Bandwidth Stats_ feature. To enable this feature, use WHM's [_Feature Manager_](https://go.cpanel.net/whmdocsFeatureManager)\ninterface (_WHM >> Home >> Packages >> Feature Manager_).","operationId":"get_bandwidth","parameters":[{"required":"false","name":"timezone","in":"query","schema":{"type":"string","example":"America/Chicago"},"description":"The timezone in which to report the data, in [Olson tz format](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).\n\n**Note:**\n\nThis parameter defaults to the server's timezone."}],"x-cpanel-available-version":"cPanel 84","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"get_bandwidth","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"Stats"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"type":"array","items":{"type":"object","properties":{"protocol":{"description":"The protocol for which to provide data.\n  * `http`\n  * `imap`\n  * `smtp`\n  * `pop3`\n  * `ftp`","enum":["http","imap","smtp","pop3","ftp"],"example":"imap","type":"string"},"bytes":{"example":"74845","description":"The domain's bandwidth usage, in bytes.","type":"integer","minimum":"0"},"month_start":{"type":"integer","format":"unix_timestamp","description":"The beginning of the report window.","example":"1561957200"},"domain":{"format":"domain","description":"The domain for which to display bandwidth statistics.\n\n**Note:**\n\nThe function only returns this value if the `protocol` return's value is `http`.","example":"example.com","type":"string"}}}},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}}}}}}}},"description":"HTTP Request was successful."}}}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"get_site_errors":{"x-tagGroups":[{"tags":["Domain Statistics"],"name":"Statistics"}],"paths":{"/Stats/get_site_errors":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return specified domain access log","tags":["Stats","Domain Statistics"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Stats \\\n  get_site_errors \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Stats/get_site_errors?domain=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Stats_get_site_errors.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Stats_get_site_errors.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/Stats/,\n    q/get_site_errors/,\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    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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Stats_get_site_errors.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Stats_get_site_errors.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    'Stats',\n    'get_site_errors',\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    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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Stats","description":"The name of the module called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings\ndescribe non-critical failures or other problematic conditions\nnoted while running a API.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"data":{"type":"array","items":{"type":"object","properties":{"entry":{"example":"[Fri Feb 13 19:58:24.420593 2009] [core:error] [pid 29228:tid 47876185720577] (13)Permission denied: [client 10.0.0.2:62908] AH00132: file permissions deny server access: /home/user/public_html/index.html","description":"The error log entry.","type":"string"},"date":{"description":"The date that the system recorded the error.","format":"unix_timestamp","example":"1234576704","type":"integer"}}}},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed. Check the errors field for more details.","type":"integer"}},"type":"object"},"func":{"type":"string","example":"get_site_errors","description":"The name of the method called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 84","parameters":[{"required":"true","name":"domain","in":"query","schema":{"example":"example.com","format":"domain","type":"string"},"description":"The domain for which to return error log entries."},{"name":"log","in":"query","required":"false","description":"The [Apache log file](https://go.cpanel.net/cpanellogfiles) to query.\nThis parameter defaults to error.\n\n* `error` - The `/var/log/apache2/error_log` file.\n* `suexec` - The `/var/log/apache2/suexec_log` file.","schema":{"example":"suexec","enum":["error","suexec"],"type":"string"}},{"description":"The number of lines to retrieve from the error log.","schema":{"minimum":"1","type":"integer","maximum":"5000","default":"300","example":"250"},"name":"maxlines","in":"query","required":"false"}],"description":"This function returns entries from a domain's error log.","operationId":"get_site_errors"}}},"tags":[{"description":"The Stats module for UAPI.","name":"Stats"},{"description":"Statistics / Domain Statistics","name":"Domain Statistics"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"get_stats_daily":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.136.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"name":"Statistics","tags":["Domain Statistics"]}],"paths":{"/Stats/get_stats_daily":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_stats_daily","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"Stats","description":"The name of the module called."},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"properties":{"domain":{"example":"example.com","description":"The domain associated with the returned daily stats.\n","type":"string"},"stats":{"nullable":"false","example":{"2024-02-02":{"pages":"14","visits":"7","bandwidth":"888296","hits":"43"},"2024-02-01":{"visits":"5","pages":"6","hits":"6","bandwidth":"81110"}},"description":"A map of date strings (YYYY-MM-DD) to daily statistics.\nUp to 45 days of history are returned. Gaps between the\nfirst available stat and yesterday are filled with zeros.\n","type":"object","additionalProperties":{"type":"object","properties":{"hits":{"example":"6","description":"The number of hits recorded on this day.","type":"integer"},"bandwidth":{"example":"81110","description":"The bandwidth used on this day (in bytes).","type":"integer"},"visits":{"description":"The number of visits recorded on this day.","example":"5","type":"integer"},"pages":{"description":"The number of pages viewed on this day.","example":"6","type":"integer"}}}}},"type":"object"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}},"examples":{"stats_by_domain":{"summary":"Object containing daily stats for the domain","value":{"result":{"data":{"domain":"example.com","stats":{"2024-02-02":{"pages":"14","visits":"7","bandwidth":"888296","hits":"43"},"2024-02-01":{"hits":"6","bandwidth":"81110","visits":"5","pages":"6"}}}}}}}}}}},"x-cpanel-available-version":"cPanel 132","parameters":[{"in":"query","name":"domain","required":"true","description":"The domain to retrieve statistics for. Must be owned by the current cPanel user.","schema":{"type":"string","example":"example.com","format":"domain"}}],"description":"This function returns the daily AwStats statistics for a domain.","operationId":"get_stats_daily","summary":"Return daily AwStats statistics for a domain","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Stats \\\n  get_stats_daily \\\n  domain='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Stats/get_stats_daily?domain=example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Stats_get_stats_daily.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Stats_get_stats_daily.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/Stats/,\n    q/get_stats_daily/,\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Stats_get_stats_daily.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Stats_get_stats_daily.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    'Stats',\n    'get_stats_daily',\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","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Stats","Domain Statistics"]}}},"tags":[{"description":"The Stats module for UAPI.","name":"Stats"},{"description":"Statistics / Domain Statistics","name":"Domain Statistics"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel & WHM."},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel & WHM."}]},"list_sites":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"name":"Statistics","tags":["Domain Statistics"]}],"paths":{"/Stats/list_sites":{"get":{"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Stats \\\n  list_sites \\\n  engine='webalizer'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Stats/list_sites?engine=webalizer","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Stats_list_sites.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Stats_list_sites.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/Stats/,\n    q/list_sites/,\n    {\n        'engine' => 'webalizer',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Stats_list_sites.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Stats_list_sites.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    'Stats',\n    'list_sites',\n    array (\n        'engine' => 'webalizer',\n    )\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}"}],"tags":["Stats","Domain Statistics"],"summary":"Return Analog statistics for all domains","x-cpanel-api-version":"UAPI","description":"This function displays the Analog statistics for the domains on a cPanel account.","operationId":"list_sites","parameters":[{"in":"query","name":"engine","required":"true","description":"The statistics engine.\n* `webalizer`\n* `analog`","schema":{"enum":["webalizer","analog"],"example":"webalizer","type":"string"}},{"description":"The web traffic type.\n * `http`\n * `ftp`","schema":{"enum":["http","ftp"],"example":"http","default":"http","type":"string"},"name":"traffic","in":"query","required":"false"}],"x-cpanel-available-version":"cPanel 84","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"list_sites"},"module":{"example":"Stats","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"items":{"properties":{"domain":{"type":"string","description":"The domain for which to display statistics.","format":"domain","example":"example.com"},"all_domains":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the statistics file's filepath is for all the domains on a cPanel account.\n* `1` - All domains.\n* `0` - An individual domain."},"path":{"description":"The filepath to the statistics file.","format":"path","example":"/tmp/user/webalizer/index.html","type":"string"},"ssl":{"example":"1","enum":["0","1"],"description":"Whether the function generates statistics from SSL requests.\n* `1` - Generates statistics for SSL requests.\n* `0` - Generates statistics for non-SSL requests.","type":"integer"}},"type":"object"},"type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}},"description":"HTTP Request was successful."}}}}},"tags":[{"name":"Stats","description":"The Stats module for UAPI."},{"description":"Statistics / Domain Statistics","name":"Domain Statistics"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}]},"list_stats_by_domain":{"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The Stats module for UAPI.","name":"Stats"},{"name":"Domain Statistics","description":"Statistics / Domain Statistics"}],"paths":{"/Stats/list_stats_by_domain":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return Analog statistics for specified domain","tags":["Stats","Domain Statistics"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Stats \\\n  list_stats_by_domain \\\n  engine='analog' \\\n  domain='example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Stats/list_stats_by_domain?engine=analog&domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Stats_list_stats_by_domain.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Stats_list_stats_by_domain.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/Stats/,\n    q/list_stats_by_domain/,\n    {\n        'engine' => 'analog',\n        'domain' => 'example.com',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Stats_list_stats_by_domain.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Stats_list_stats_by_domain.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    'Stats',\n    'list_stats_by_domain',\n    array (\n        'engine' => 'analog',\n        'domain' => 'example.com',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-available-version":"cPanel 84","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"Stats","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"data":{"items":{"type":"object","properties":{"url":{"type":"string","description":"The URL of the file from which the system generates statistics reports.","example":"tmp/cptest/analog/8.html.com"},"date":{"example":"1565795929","format":"unix_timestamp","description":"The current date and time.","type":"integer"}}},"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","description":"The name of the method called.","example":"list_stats_by_domain"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function returns a domain's Analog statistics.","operationId":"list_stats_by_domain","parameters":[{"description":"The statistics engine. `analog` is the only possible value.","schema":{"type":"string","enum":["analog"],"example":"analog"},"name":"engine","in":"query","required":"true"},{"description":"The domain from which to retrieve statistics.","schema":{"type":"string","format":"domain","example":"example.com"},"name":"domain","in":"query","required":"true"},{"schema":{"enum":["0","1"],"example":"1","default":"1","type":"integer"},"description":"Whether to return statistics from SSL requests.\n  * `1` - Return statistics for SSL requests.\n  * `0` - Return statistics for non-SSL requests.","required":"false","in":"query","name":"ssl"}]}}},"x-tagGroups":[{"tags":["Domain Statistics"],"name":"Statistics"}]}},"CacheBuster":{"read":{"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/CacheBuster/read":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return web browser cached file override ID","tags":["CacheBuster","Browser Cache Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CacheBuster \\\n  read\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/CacheBuster/read","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CacheBuster_read.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CacheBuster_read.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/CacheBuster/,\n    q/read/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CacheBuster_read.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CacheBuster_read.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    'CacheBuster',\n    'read'\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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"CacheBuster"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"type":"object","properties":{"cache_id":{"example":"11381138","description":"An eight-digit random integer that the system uses to work around a browser's caching mechanism.","minimum":"10000000","maximum":"99999999","type":"integer"}}},"status":{"enum":["0","1"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"}},"type":"object"},"func":{"example":"read","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.46","parameters":[],"description":"This function returns the current `CacheBuster` id. The system uses this ID to force the browser to fetch a new resource when that resource already exists in the web browser cache. This is useful when an application has updated the resource on the server. You should append this ID to the end of the url in the query-string. For example, if you are accessing a url like:\n\n`https://example.com/styled/basic/sprites/icon_spritemap.css`\n\n To force the browser to fetch the updated version, you would append the following:\n\n `https://example.com/styled/basic/sprites/icon_spritemap.css?<CacheBusterID>`\n\n **Note**\n\n The application that updates the resource at this url on the server **must** call the `CacheBuster::update` function when it updates the resource to signify that update.","operationId":"CacheBuster-read"}}},"x-tagGroups":[{"name":"cPanel Theme Management","tags":["Browser Cache Management"]}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"CacheBuster","description":"The CacheBuster module for UAPI."},{"name":"Browser Cache Management","description":"cPanel Theme Management / Browser Cache Management"}]},"update":{"paths":{"/CacheBuster/update":{"get":{"tags":["CacheBuster","Browser Cache Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CacheBuster \\\n  update\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/CacheBuster/update","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CacheBuster_update.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CacheBuster_update.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/CacheBuster/,\n    q/update/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CacheBuster_update.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CacheBuster_update.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    'CacheBuster',\n    'update'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Create web browser cached file override ID","description":"This function generates a random integer (the CacheBuster ID). Use this ID to work with and around a browser's caching mechanism.","operationId":"update","parameters":[],"x-cpanel-available-version":"cPanel 11.46","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"update","type":"string"},"module":{"description":"The name of the module called.","example":"CacheBuster","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"properties":{"cache_id":{"description":"random integer that the system uses to work with and around a browser's caching mechanism. An eight-digit integer.","example":"11381138","type":"integer"}},"type":"object"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}}}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["Browser Cache Management"],"name":"cPanel Theme Management"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"CacheBuster","description":"The CacheBuster module for UAPI."},{"description":"cPanel Theme Management / Browser Cache Management","name":"Browser Cache Management"}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}},"LastLogin":{"get_last_or_current_logged_in_ip":{"x-tagGroups":[{"tags":["Login Information"],"name":"Security"}],"paths":{"/LastLogin/get_last_or_current_logged_in_ip":{"get":{"parameters":[],"operationId":"get_last_or_current_logged_in_ip","description":"This function returns the IP address of the user who most recently logged in.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_last_or_current_logged_in_ip"},"module":{"description":"The name of the module called.","example":"LastLogin","type":"string"},"result":{"properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"metadata":{"properties":{}},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` Success.\n* `0` Failed. Check the errors field for more details."},"data":{"type":"array","description":"The IP address of the user who most recently logged in.","items":{"format":"ipv4","example":"192.168.0.1","type":"string"}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.48","tags":["LastLogin","Login Information"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  LastLogin \\\n  get_last_or_current_logged_in_ip\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/LastLogin/get_last_or_current_logged_in_ip","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LastLogin_get_last_or_current_logged_in_ip.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/LastLogin_get_last_or_current_logged_in_ip.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/LastLogin/,\n    q/get_last_or_current_logged_in_ip/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LastLogin_get_last_or_current_logged_in_ip.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/LastLogin_get_last_or_current_logged_in_ip.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    'LastLogin',\n    'get_last_or_current_logged_in_ip'\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","summary":"Return last authenticated login IP address"}}},"tags":[{"name":"LastLogin","description":"The LastLogin module for UAPI."},{"description":"Security / Login Information","name":"Login Information"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2"}},"ClamScanner":{"get_scan_status":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.93.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"x-tagGroups":[{"tags":["Antivirus Protection (ClamAV)"],"name":"Optional Applications"}],"paths":{"/ClamScanner/get_scan_status":{"get":{"x-cpanel-api-version":"UAPI","summary":"Request virus scan status","tags":["ClamScanner","Antivirus Protection (ClamAV)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ClamScanner \\\n  get_scan_status\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/get_scan_status","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_get_scan_status.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ClamScanner_get_scan_status.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/ClamScanner/,\n    q/get_scan_status/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_get_scan_status.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ClamScanner_get_scan_status.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    'ClamScanner',\n    'get_scan_status'\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-available-version":"cPanel 94","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"get_scan_status","description":"The name of the method called."},"module":{"example":"ClamScanner","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"type":"object","properties":{"total_file_count":{"description":"The total number of files found to scan.","example":"135","minimum":"0","type":"integer"},"scanned_file_size":{"type":"integer","minimum":"0","description":"The number of bytes of data scanned.","example":"6022"},"current_file":{"description":"The current file being scanned.","example":"/home/username/afilename.txt","type":"string"},"time_started":{"description":"The epoch timestamp of the beginning of the last scan.","example":"1608593571","minimum":"0","type":"string"},"scan_complete":{"type":"integer","description":"Whether the last scan has completed.\n* `1` - scan has completed.\n* `0` - scan has **not** completed.","example":"1","enum":["0","1"]},"infected_files":{"example":["/home/username/afile/witha/virus.txt","/home/username/we/gotcha.exe"],"description":"List of files scanned and found to be infected.","type":"array"},"scanned_file_count":{"description":"The number of files already scanned.","example":"135","minimum":"0","type":"integer"},"total_file_size_MiB":{"description":"The total number of megabytes of data found to scan.","example":"3640222","type":"integer","minimum":"0"}}},"metadata":{"properties":{}},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"}},"type":"object"}},"type":"object"}}}}},"operationId":"ClamScanner::get_scan_status","description":"This function gets the status of a ClamAV® scan on a directory.\n\n**Note**:\n\nYou must run the APIs in this order:\n\n1. Run [`ClamScanner::start_scan`](https://go.cpanel.net/ClamScanner-start-scan) to start the virus scan.\n2. Run [`ClamScanner::get_scan_status`](https://go.cpanel.net/ClamScanner-get-scan-status) in a loop until the scan is finished.\n3. Run [`ClamScanner::list_infected_files`](https://go.cpanel.net/ClamScanner-list-infected-files) to get a report of the complete list of infected files.\n4. Decide how you want to handle each infected file.\n5. Run [`ClamScanner::disinfect_files`](https://go.cpanel.net/ClamScanner-disinfect-files) to queue the disinfection of the files.\n6. Run [`ClamScanner::check_disinfection_status`](https://go.cpanel.net/ClamScanner-check-disinfection-status) in a loop until you get a done status.","parameters":[]}}},"tags":[{"name":"ClamScanner","description":"The ClamScanner module provides methods for ClamAV® virus scans and disinfection."},{"name":"Antivirus Protection (ClamAV)","description":"Optional Applications / Antivirus Protection (ClamAV)"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}]},"start_scan":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.93.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"openapi":"3.0.2","x-tagGroups":[{"tags":["Antivirus Protection (ClamAV)"],"name":"Optional Applications"}],"paths":{"/ClamScanner/start_scan":{"get":{"x-cpanel-api-version":"UAPI","summary":"Start virus scan","tags":["ClamScanner","Antivirus Protection (ClamAV)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ClamScanner \\\n  start_scan \\\n  scan_type='home'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/start_scan?scan_type=home","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_start_scan.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ClamScanner_start_scan.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/ClamScanner/,\n    q/start_scan/,\n    {\n        'scan_type' => 'home',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_start_scan.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ClamScanner_start_scan.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    'ClamScanner',\n    'start_scan',\n    array (\n        'scan_type' => 'home',\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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"data":{"type":"object","nullable":"true","default":null},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"}}},"module":{"description":"The name of the module called.","example":"ClamScanner","type":"string"},"func":{"type":"string","example":"start_scan","description":"The name of the method called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 94","parameters":[{"required":"true","in":"query","name":"scan_type","schema":{"example":"home","enum":["home","mail","public_html","public_ftp"]},"description":"The type of directory to scan.\n\n* `home` — User's entire home directory\n* `mail` — User's email directory\n* `public_html` — User's web directory\n* `public_ftp` — User's ftp directory"}],"operationId":"ClamScanner::start_scan","description":"This function starts a ClamAV® scan on a directory.\n\n**Note**:\n\nYou must run the APIs in this order:\n\n1. Run [`ClamScanner::start_scan`](https://go.cpanel.net/ClamScanner-start-scan) to start the virus scan.\n2. Run [`ClamScanner::get_scan_status`](https://go.cpanel.net/ClamScanner-get-scan-status) in a loop until the scan is finished.\n3. Run [`ClamScanner::list_infected_files`](https://go.cpanel.net/ClamScanner-list-infected-files) to get a report of the complete list of infected files.\n4. Decide how you want to handle each infected file.\n5. Run [`ClamScanner::disinfect_files`](https://go.cpanel.net/ClamScanner-disinfect-files) to queue the disinfection of the files.\n6. Run [`ClamScanner::check_disinfection_status`](https://go.cpanel.net/ClamScanner-check-disinfection-status) in a loop until you get a done status."}}},"tags":[{"description":"The ClamScanner module provides methods for ClamAV® virus scans and disinfection.","name":"ClamScanner"},{"description":"Optional Applications / Antivirus Protection (ClamAV)","name":"Antivirus Protection (ClamAV)"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"get_scan_paths":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The ClamScanner module provides methods for ClamAV® virus scans and disinfection.","name":"ClamScanner"},{"name":"Antivirus Protection (ClamAV)","description":"Optional Applications / Antivirus Protection (ClamAV)"}],"paths":{"/ClamScanner/get_scan_paths":{"get":{"operationId":"ClamScanner::get_scan_paths","description":"This function gets the available local paths that a cPanel account is permitted to scan.\n\n**Note**:\n\nThe system determines the available scan types based on what the system administrator has set in WHM's [Configure ClamAV®](https://go.cpanel.net/configureclamavscanner) page.\n\n**Note**:\n\nYou must run the APIs in this order:\n\n1. Run [`ClamScanner::start_scan`](https://go.cpanel.net/ClamScanner-start-scan) to start the virus scan.\n2. Run [`ClamScanner::get_scan_status`](https://go.cpanel.net/ClamScanner-get-scan-status) in a loop until the scan is finished.\n3. Run [`ClamScanner::list_infected_files`](https://go.cpanel.net/ClamScanner-list-infected-files) to get a report of the complete list of infected files.\n4. Decide how you want to handle each infected file.\n5. Run [`ClamScanner::disinfect_files`](https://go.cpanel.net/ClamScanner-disinfect-files) to queue the disinfection of the files.\n6. Run [`ClamScanner::check_disinfection_status`](https://go.cpanel.net/ClamScanner-check-disinfection-status) in a loop until you get a done status.","parameters":[],"x-cpanel-available-version":"cPanel 94","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"data":{"properties":{"id":{"type":"string","description":"The type of path\n* `home` — The cPanel account's entire home directory.\n* `mail` — The cPanel account's email directory.\n* `public_html` — The cPanel account's web directory.\n* `public_ftp` — The cPanel account's FTP directory.","enum":["home","mail","public_html","public_ftp"],"example":"home"},"message":{"type":"string","example":"Scan Entire Home Directory","description":"Short description of the path"}},"type":"object"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"ClamScanner"},"func":{"type":"string","example":"get_scan_paths","description":"The name of the method called."}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ClamScanner \\\n  get_scan_paths\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/get_scan_paths"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_get_scan_paths.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ClamScanner_get_scan_paths.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/ClamScanner/,\n    q/get_scan_paths/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_get_scan_paths.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ClamScanner_get_scan_paths.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    'ClamScanner',\n    'get_scan_paths'\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}"}],"tags":["ClamScanner","Antivirus Protection (ClamAV)"],"summary":"Return virus scan types","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Antivirus Protection (ClamAV)"],"name":"Optional Applications"}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.93.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"list_infected_files":{"tags":[{"description":"The ClamScanner module provides methods for ClamAV® virus scans and disinfection.","name":"ClamScanner"},{"name":"Antivirus Protection (ClamAV)","description":"Optional Applications / Antivirus Protection (ClamAV)"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"name":"Optional Applications","tags":["Antivirus Protection (ClamAV)"]}],"paths":{"/ClamScanner/list_infected_files":{"get":{"tags":["ClamScanner","Antivirus Protection (ClamAV)"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ClamScanner \\\n  list_infected_files\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/list_infected_files","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_list_infected_files.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ClamScanner_list_infected_files.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/ClamScanner/,\n    q/list_infected_files/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_list_infected_files.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ClamScanner_list_infected_files.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    'ClamScanner',\n    'list_infected_files'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return infected file list","operationId":"ClamScanner::list_infected_files","description":"This function lists infected files from a ClamAV® virus scan.\n\n**Note**:\n\nYou must run the APIs in this order:\n\n1. Run [`ClamScanner::start_scan`](https://go.cpanel.net/ClamScanner-start-scan) to start the virus scan.\n2. Run [`ClamScanner::get_scan_status`](https://go.cpanel.net/ClamScanner-get-scan-status) in a loop until the scan is finished.\n3. Run [`ClamScanner::list_infected_files`](https://go.cpanel.net/ClamScanner-list-infected-files) to get a report of the complete list of infected files.\n4. Decide how you want to handle each infected file.\n5. Run [`ClamScanner::disinfect_files`](https://go.cpanel.net/ClamScanner-disinfect-files) to queue the disinfection of the files.\n6. Run [`ClamScanner::check_disinfection_status`](https://go.cpanel.net/ClamScanner-check-disinfection-status) in a loop until you get a done status.","parameters":[],"x-cpanel-available-version":"cPanel 94","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"data":{"type":"array","items":{"type":"object","properties":{"virus_type":{"description":"A virus type.","example":"Eicar-Signature","type":"string"},"file":{"type":"string","example":"/home/username/infected_file.txt","description":"An absolute path to the infected file on the system.","format":"path"}}}},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}},"type":"object"},"module":{"type":"string","example":"ClamScanner","description":"The name of the module called."},"func":{"example":"list_infected_files","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}}}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.93.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"disinfect_files":{"paths":{"/ClamScanner/disinfect_files":{"post":{"summary":"Start disinfecting files with viruses","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"echo '{\"home/unsure\":\"ignore\",\"home/virus1\":\"delete\",\"home/virus2\":\"quarantine\"}' | uapi --user=username --input=json --output=jsonpretty ClamScanner disinfect_files"},{"source":"POST /cpsess##########/execute/ClamScanner/disinfect_files HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 74\n\n{\"home/unsure\":\"ignore\",\"home/virus1\":\"delete\",\"home/virus2\":\"quarantine\"}","lang":"HTTP","label":"HTTP Request (Wire Format)"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"actions":{"additionalProperties":{"type":"string","enum":["cleanse_mailbox","delete","quarantine","ignore"],"description":"The name of the property is a path to the file. The path may be either a full path to the file or a users home directory relative path to the file.\n\nThe value of the property is on of the following:\n\n* `cleanse_mailbox` — Cleanse the specified mailbox.\n* `delete` — Delete the file.\n* `quarantine` — Move the file to the quarantine directory.\n* `ignore` - Ignore the file.\n\n**Note**\n\nOnly include files that the scanner identified as containing a virus. All other file paths passed will be ignored."},"type":"object","example":{"home/unsure":"ignore","home/virus2":"quarantine","home/virus1":"delete"},"description":"The user provides the actions to perform on each specific infected file found in the scan."}},"type":"object"}}}},"tags":["ClamScanner","Antivirus Protection (ClamAV)"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"data":{"type":"object","properties":{"log":{"type":"string","example":"/home/user/.clamavconnector.disinfection.log","description":"Path to the disinfection log file. The log file will contain a list of JSON objects one per line.\n\nIf the last line is:\n\n`{ \"status\": \"done\" }`\n\nthe requested files with viruses have be handled as requested.  Use the /ClamScanner/check_disinfection_status\nAPI to check the status of a running or finished disinfection."},"task_id":{"type":"string","description":"The Task Queue system's task ID number.","example":"00000000/5a9ec8dd4c345d"}}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"metadata":{"properties":{}}}},"module":{"type":"string","description":"The name of the module called.","example":"ClamScanner"},"func":{"example":"disinfect_files","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"94","description":"This function applies the disinfection option selected by the user\nfor each infected file.\n\n**Note:**\n\nYou must run the APIs in this order:\n\n1. Run [`ClamScanner::start_scan`](https://go.cpanel.net/ClamScanner-start-scan) to start the virus scan.\n2. Run [`ClamScanner::get_scan_status`](https://go.cpanel.net/ClamScanner-get-scan-status) in a loop until the scan is finished.\n3. Run [`ClamScanner::list_infected_files`](https://go.cpanel.net/ClamScanner-list-infected-files) to get a report of the complete list of infected files.\n4. Decide how you want to handle each infected file.\n5. Run [`ClamScanner::disinfect_files`](https://go.cpanel.net/ClamScanner-disinfect-files) to queue the disinfection of the files.\n6. Run [`ClamScanner::check_disinfection_status`](https://go.cpanel.net/ClamScanner-check-disinfection-status) in a loop until you get a done status.","operationId":"disinfect_files"}}},"x-tagGroups":[{"name":"Optional Applications","tags":["Antivirus Protection (ClamAV)"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"ClamScanner","description":"The ClamScanner module provides methods for ClamAV® virus scans and disinfection."},{"name":"Antivirus Protection (ClamAV)","description":"Optional Applications / Antivirus Protection (ClamAV)"}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"check_disinfection_status":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/ClamScanner/check_disinfection_status":{"get":{"parameters":[{"schema":{"type":"integer","minimum":"1","example":"10"},"description":"The unique `id` of the message you last received from this same log.\n\nThe API will return only the records after the specified `last_id`.\n\nIf this parameter is not provided, the entire log is returned.\n\n**Note:**\n\nFor improved performance, we recommend applications include the last record ID (last_id)\nfrom a previous call to this API, so only messages since the previous API call are returned.","name":"last_id","in":"query"}],"description":"This function checks the status of the previously queued disinfection\nof infected files.\n\n**Note:**\n\nYou must run the APIs in this order:\n\n1. Run [`ClamScanner::start_scan`](https://go.cpanel.net/ClamScanner-start-scan) to start the virus scan.\n2. Run [`ClamScanner::get_scan_status`](https://go.cpanel.net/ClamScanner-get-scan-status) in a loop until the scan is finished.\n3. Run [`ClamScanner::list_infected_files`](https://go.cpanel.net/ClamScanner-list-infected-files) to get a report of the complete list of infected files.\n4. Decide how you want to handle each infected file.\n5. Run [`ClamScanner::disinfect_files`](https://go.cpanel.net/ClamScanner-disinfect-files) to queue the disinfection of the files.\n6. Run [`ClamScanner::check_disinfection_status`](https://go.cpanel.net/ClamScanner-check-disinfection-status) in a loop until you get a done status.\n\nIf you want to display the progress, you can render the `ClamScanner::check_disinfection_status` returned 'result{data}{details}' array where the `type` is `step`.\n\nEach `step` record indicates the action taken on a specific file in the set being processed.","operationId":"ClamScanner::check_disinfection_status","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"check_disinfection_status","description":"The name of the method called.","type":"string"},"module":{"example":"ClamScanner","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"metadata":{"properties":{}},"data":{"type":"object","properties":{"log":{"example":"/home/user/.clamavconnector.disinfection.log","description":"Path to the disinfection log file. The log file will contain a list of JSON objects one per line.  If the last line includes `\"type\":\"done\"`, the file disinfection is complete.","type":"string"},"details":{"type":"array","items":{"oneOf":[{"required":["type","state"],"type":"object","properties":{"id":{"type":"number","example":"2","description":"The task processing order."},"type":{"type":"string","description":"* `step` - Record about a single file being processes.","enum":["step"]},"message":{"type":"string","description":"Optional message that may include more information about errors."},"file":{"type":"string","example":"/home/user/virus","description":"The absolute path to the file."},"state":{"type":"string","enum":["deleted","error","mailbox-cleansed","no-action","quarantined"],"example":"deleted","description":"The state of the step. It will be one of the following:\n\n* `deleted` - The file was deleted.\n* `error` - An error occurred while processing the file.\n* `mailbox-cleansed` - The mailbox was clear of viruses.\n* `no-action` - No action was taken on the file.\n* `quarantined` - The file was quarantined."}}},{"properties":{"type":{"enum":["issue"],"description":"* `issue` - Record that the disinfection is complete for all files indicated.","type":"string"},"message":{"type":"string","description":"Optional message that may include more information about errors and warnings."},"id":{"type":"number","description":"The task processing order.","example":"2"},"state":{"example":"warning","enum":["error","warning"],"description":"The state of the issue. It will be one of the following:\n\n* `error` - An error occurred while starting or finishing the disinfection.\n* `warning` - A non-cricitcal problem occurred while starting or finishing the disinfection.","type":"string"}},"type":"object","required":["type","state"]},{"required":["type"],"type":"object","properties":{"id":{"description":"The task processing order.","example":"2","type":"number"},"type":{"type":"string","enum":["done"],"description":"* `done` - Record that the disinfection is complete for all files indicated."},"message":{"type":"string","description":"Optional message that may include more information about errors."},"state":{"description":"The state of the step. It will be one of the following:\n\n* `error` - An error occurred while processing the file.\n* `info` - The message is information only.\n* `success` - The disinfection was successful.","example":"success","enum":["error","info","success"],"type":"string"}}}]},"description":"The list of events recorded in the log. If you pass the `last_id` parameter, only records in the log after that id are returned."},"status":{"description":"* `done` - The disinfection is finished.\n* `none` - There is no disinfection scheduled.\n* `queued` - The disinfection is queued.\n* `running` - The disinfection is in progress.","enum":["done","queued","running"],"example":"done","type":"string"}}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}}}},"x-cpanel-available-version":"94","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  ClamScanner \\\n  check_disinfection_status\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/ClamScanner/check_disinfection_status","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ClamScanner_check_disinfection_status.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ClamScanner_check_disinfection_status.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/ClamScanner/,\n    q/check_disinfection_status/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ClamScanner_check_disinfection_status.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ClamScanner_check_disinfection_status.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    'ClamScanner',\n    'check_disinfection_status'\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}"}],"tags":["ClamScanner","Antivirus Protection (ClamAV)"],"summary":"Request disinfection process status","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Antivirus Protection (ClamAV)"],"name":"Optional Applications"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"name":"ClamScanner","description":"The ClamScanner module provides methods for ClamAV® virus scans and disinfection."},{"description":"Optional Applications / Antivirus Protection (ClamAV)","name":"Antivirus Protection (ClamAV)"}]}},"Mysql":{"rename_database":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features.\nUse this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / Database Management","name":"Database Management"}],"paths":{"/Mysql/rename_database":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update MySQL database name","tags":["Mysql","Database Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  rename_database \\\n  oldname='mydb' \\\n  newname='newlyrenamed'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/rename_database?oldname=mydb&newname=newlyrenamed"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_rename_database.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_rename_database.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/Mysql/,\n    q/rename_database/,\n    {\n        'oldname' => 'mydb',\n        'newname' => 'newlyrenamed',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_rename_database.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_rename_database.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    'Mysql',\n    'rename_database',\n    array (\n        'oldname' => 'mydb',\n        'newname' => 'newlyrenamed',\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}"}],"x-cpanel-available-version":"cPanel 11.44","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"Mysql","type":"string"},"result":{"properties":{"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"default":null,"nullable":"true","type":"object"},"metadata":{"properties":{}},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API.\nWarnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"description":"The name of the method called.","example":"rename_database","type":"string"}},"type":"object"}}}}},"description":"This function renames a MySQL® database.\n\nMySQL does not allow you to rename a database. When cPanel & WHM \"renames\" a database, the\nsystem performs the following steps:\n1. The system creates a new database.\n2. The system moves data from the old database to the new database.\n3. The system recreates grants and stored code in the new database.\n4. The system deletes the old database and its grants.\n\n**Warning:**\n\n* It is potentially dangerous to rename a MySQL database. We **strongly** recommend that you\nperform a backup of the database before you attempt to rename it.\n* If any of the first three steps fail, the system returns an error and attempts to restore the database's original state.\n If the restoration process fails, the API function's error response describes these additional failures.\n* In rare cases, the system creates the second database successfully, but fails to delete the old database or grants.\n The system treats the rename action as a success; however,\n the API function returns warnings that describe the failure to delete the old database or grants.\n\n**Important:**\n\nWhen you disable the [MySQL/MariaDB role](https://go.cpanel.net/serverroles)\n**and** remote MySQL is **not** already configured, the system **disables** this function.","operationId":"Mysql-rename_database","parameters":[{"required":"true","in":"query","name":"oldname","schema":{"example":"mydb","type":"string"},"description":"The database's current name."},{"required":"true","name":"newname","in":"query","schema":{"example":"newlyrenamed","maxLength":"64","type":"string"},"description":"The database's new name.\n\n**Important:**\n\n* If database prefixing is enabled, you **must** prefix this value with the account prefix\nand an underscore (`_`). For example, for the `dbuser` database on the user cPanel account,\npass in a value of `user_dbuser`.\n* The maximum length of the database name is 64 characters. However, due to the method that\ncPanel & WHM uses to store MySQL database names, each underscore character requires two\ncharacters of that limit. Therefore, if you enable database prefixing, the maximum length of\nthe database name is 63 characters, which includes both the database prefix and the\nunderscore character. Each additional underscore requires another two characters of that\nlimit."}]}}},"x-tagGroups":[{"tags":["Database Management"],"name":"MySQL and MariaDB"}]},"get_host_notes":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / Remote Databases","name":"Remote Databases"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Remote Databases"],"name":"MySQL and MariaDB"}],"paths":{"/Mysql/get_host_notes":{"get":{"operationId":"get_host_notes","description":"This function returns the notes associated with the account's remote MySQL® hosts.\n\n**Important:**\n\n  When you disable the [*MySQL/MariaDB* role](https://go.cpanel.net/serverroles)\n  **and** remote MySQL is **not** already configured, the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 74","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"get_host_notes","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"Mysql"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"additionalProperties":{"type":"string","description":"The notes associated with the account's Remote MySQL hosts.","example":"Located somewhere in the Ford Galaxy"},"type":"object","example":{"1.2.3.45":"The combination on my luggage","8.8.8.8":"Located on Spaceball 1","12.34.56.78":"Located somewhere in the Ford Galaxy"},"description":"The keys are remote MySQL hostnames or IP addresses and values are their corresponding notes."},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}},"type":"object"}}}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  get_host_notes\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/get_host_notes","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_get_host_notes.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_get_host_notes.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/Mysql/,\n    q/get_host_notes/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_get_host_notes.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_get_host_notes.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    'Mysql',\n    'get_host_notes'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Mysql","Remote Databases"],"summary":"Return remote MySQL host notes","x-cpanel-api-version":"UAPI"}}}},"add_host_note":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features.\nUse this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / Remote Databases","name":"Remote Databases"}],"paths":{"/Mysql/add_host_note":{"get":{"summary":"Add remote MySQL host note","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  add_host_note \\\n  host='192.168.1.6' \\\n  note='A remote mysql server for storing my data'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/add_host_note?host=192.168.1.6&note=A%20remote%20mysql%20server%20for%20storing%20my%20data","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_add_host_note.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_add_host_note.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/Mysql/,\n    q/add_host_note/,\n    {\n        'host' => '192.168.1.6',\n        'note' => 'A remote mysql server for storing my data',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_add_host_note.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_add_host_note.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    'Mysql',\n    'add_host_note',\n    array (\n        'host' => '192.168.1.6',\n        'note' => 'A remote mysql server for storing my data',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mysql","Remote Databases"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"Mysql","description":"The name of the module called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"nullable":"true","default":null,"type":"object"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API.\nWarnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"example":"add_host_note","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 74","parameters":[{"description":"The remote MySQL server's hostname or IP address.\n\nYou may use the following IP address formats:\n\n* `192.168.1.6` — IP address.\n* `192.168.%.%` — Range with the percent (%) symbol as a wildcard.\n* `192.168.0.0/16` — Range in CIDR format.","example":"192.168.1.6","schema":{"oneOf":[{"type":"string","format":"ipv4","example":"192.168.1.6"},{"format":"domain","example":"remote.example.com","type":"string"},{"type":"string","example":"192.168.%.%","description":"IP address range with the percent (%) symbol as a wildcard."},{"example":"192.168.0.0/16","description":"IP address range in CIDR format.","type":"string"}]},"name":"host","in":"query","required":"true"},{"description":"note that describes the remote MySQL server.","schema":{"example":"A remote mysql server for storing my data","type":"string"},"name":"note","in":"query","required":"true"}],"operationId":"Mysql-add_host_note","description":"This function adds a note about a remote MySQL® server.\n\n**Important:**\n\n* If you attempt to add a note to an unauthorized remote MySQL server, the function will fail.\n* When you **disable** the [MySQL role](https://go.cpanel.net/serverroles), the system disables this function."}}},"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Remote Databases"]}]},"locate_server":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"description":"MySQL and MariaDB / Database Information","name":"Database Information"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Database Information"],"name":"MySQL and MariaDB"}],"paths":{"/Mysql/locate_server":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  locate_server\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/locate_server","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_locate_server.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_locate_server.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/Mysql/,\n    q/locate_server/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_locate_server.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_locate_server.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    'Mysql',\n    'locate_server'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mysql","Database Information"],"summary":"Return MySQL server host information","x-cpanel-api-version":"UAPI","parameters":[],"operationId":"locate_server","description":"This function returns information about the account's MySQL® host.\n\n**Important:**\n\nWhen you disable the [MySQL/MariaDB role](https://go.cpanel.net/serverroles#roles) **and** remote MySQL is **not** already configured, the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"Mysql","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"remote_host":{"description":"The remote MySQL server's hostname or IP address.","oneOf":[{"type":"string","example":"192.0.2.1","description":"An IP address.","format":"ipv4"},{"example":"remote.example.com","description":"A hostname.","format":"domain","type":"string"}]},"is_remote":{"enum":["0","1"],"example":"1","description":"Whether the host is a remote MySQL server.\n* `1` - Remote host.\n* `0` - Local host.","type":"integer"}}},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"example":"locate_server","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.52"}}}},"get_privileges_on_database":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features.\nUse this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"name":"MySQL and MariaDB","tags":["User Management"]}],"paths":{"/Mysql/get_privileges_on_database":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  get_privileges_on_database \\\n  user='dbuser' \\\n  database='mydb'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/get_privileges_on_database?user=dbuser&database=mydb","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_get_privileges_on_database.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_get_privileges_on_database.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/Mysql/,\n    q/get_privileges_on_database/,\n    {\n        'user' => 'dbuser',\n        'database' => 'mydb',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_get_privileges_on_database.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_get_privileges_on_database.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    'Mysql',\n    'get_privileges_on_database',\n    array (\n        'user' => 'dbuser',\n        'database' => 'mydb',\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Mysql","User Management"],"summary":"Return MySQL user privileges","x-cpanel-api-version":"UAPI","description":"This function lists a MySQL® database user's privileges.\n\n**Important:**\n\nWhen you disable the [MySQL role](https://go.cpanel.net/serverroles)\nand remote MySQL is not already configured, the system disables this function.","operationId":"Mysql-get_privileges_on_database","parameters":[{"required":"true","in":"query","name":"user","schema":{"type":"string","example":"dbuser"},"description":"The database user's name.\n\n**Important:**\n\nIf database prefixing is enabled, you **must** prefix this value with the account prefix and an underscore (`_`).\n\nFor example, for the `dbuser` user on the `user` cPanel account, pass in a value of `user_dbuser`."},{"in":"query","name":"database","required":"true","description":"The database name.","schema":{"example":"mydb","type":"string"}}],"x-cpanel-available-version":"cPanel 11.44","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Mysql","type":"string"},"result":{"type":"object","properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API.\nWarnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"data":{"items":{"type":"string","example":"CREATE"},"description":"An array of privileges.\n\n**Note:**\n\nIf the database user does not have privileges on the database database,\nthis array will return empty.\n* `ALL PRIVILEGES`\n* One or more of the following individual privileges:\n  * `ALTER`\n  * `ALTER ROUTINE`\n  * `CREATE`\n  * `CREATE ROUTINE`\n  * `CREATE TEMPORARY TABLES`\n  * `CREATE VIEW`\n  * `DELETE`\n  * `DROP`\n  * `EVENT`\n  * `EXECUTE`\n  * `INDEX`\n  * `INSERT`\n  * `LOCK TABLES`\n  * `REFERENCES`\n  * `SELECT`\n  * `SHOW VIEW`\n  * `TRIGGER`\n  * `UPDATE`","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"description":"The name of the method called.","example":"get_privileges_on_database","type":"string"}}}}}}}}}},"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / User Management","name":"User Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"update_privileges":{"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"name":"User Management","description":"MySQL and MariaDB / User Management"}],"paths":{"/Mysql/update_privileges":{"get":{"operationId":"update_privileges","description":"This function updates privileges for all MySQL® databases and users on an account.\n\n**Important:**\n\nWhen you disable the [MySQL/MariaDB role](https://go.cpanel.net/serverroles) **and**\nremote MySQL is **not** configured, the system **disables** this function.","parameters":[],"x-cpanel-internal-only":"false","x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Mysql","description":"The name of the module called."},"func":{"description":"The name of the method called.","example":"update_privileges","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  update_privileges\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/update_privileges","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_update_privileges.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Mysql_update_privileges.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/Mysql/,\n    q/update_privileges/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_update_privileges.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Mysql_update_privileges.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    'Mysql',\n    'update_privileges'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Mysql","User Management"],"summary":"Update MySQL® privileges","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["User Management"],"name":"MySQL and MariaDB"}]},"create_user":{"paths":{"/Mysql/create_user":{"get":{"tags":["Mysql","User Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  create_user \\\n  name='dbuser' \\\n  password='12345luggage'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/create_user?name=dbuser&password=12345luggage","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_create_user.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_create_user.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/Mysql/,\n    q/create_user/,\n    {\n        'name' => 'dbuser',\n        'password' => '12345luggage',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_create_user.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_create_user.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    'Mysql',\n    'create_user',\n    array (\n        'name' => 'dbuser',\n        'password' => '12345luggage',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Create MySQL user","parameters":[{"required":"true","name":"name","in":"query","schema":{"type":"string","example":"dbuser"},"description":"A valid database username.\n\nImportant:\n====\n\nTo learn more about database username limits, check your database type:\n\nMySQL 5.6\n----\n\nMySQL version 5.6 limits the database username to 16 characters. The server uses the first nine characters of this limit for the database prefix. The database prefix uses the cPanel account's username and an underscore (`_`). The server only applies the first eight characters of the cPanel account's username.\n\nFor example:\n\n* A `db_` database prefix allows MySQL usernames of up to 13 characters.\n* An `example_` database prefix allows MySQL usernames of up to eight characters.\n\nMySQL 5.7+\n----\n\nMySQL versions 5.7 and later limit the database username to 32 characters. The server uses the first nine characters of this limit for the database prefix. The database prefix uses the cPanel account's username and an underscore (`_`). The server only applies the first eight characters of the cPanel account's username.\n\nFor example:\n\n* A `db_` database prefix allows MySQL usernames of up to 29 characters.\n* An `example_` database prefix allows MySQL usernames of up to 24 characters.\n\nMariaDB\n----\n\nMariaDB limits the database username to 47 characters. The server uses the first nine characters of this limit for the database prefix. The database prefix uses the cPanel account's username and an underscore (`_`). The server only applies the first eight characters of the cPanel account's username.\n\nFor example:\n\n* A `db_` database prefix allows MariaDB usernames of up to 44 characters.\n* An `example_` database prefix allows MariaDB usernames of up to 39 characters."},{"in":"query","name":"password","required":"true","description":"The new user's password.","schema":{"type":"string","example":"12345luggage"}},{"required":"false","name":"prefix-size","in":"query","schema":{"example":"16","enum":["8","16"],"default":"16","type":"integer"},"description":"The desired prefix size."}],"operationId":"Mysql-create_user","description":"This function creates a MySQL® database user.\n\n**Important:**\n\nWhen you **disable** the [MySQL role](https://go.cpanel.net/serverroles) and remote MySQL is not already configured, the system disables this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API.\nWarnings describe non-critical failures or other problematic conditions noted while running a API."},"data":{"type":"object","nullable":"true","default":null},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"metadata":{"properties":{}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","example":"Mysql","description":"The name of the module called."},"func":{"type":"string","description":"The name of the method called.","example":"create_user"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.44"}}},"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["User Management"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"name":"User Management","description":"MySQL and MariaDB / User Management"}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features.\nUse this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"dump_database_schema":{"x-tagGroups":[{"tags":["Database Management"],"name":"MySQL and MariaDB"}],"paths":{"/Mysql/dump_database_schema":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return MySQL database schema","tags":["Mysql","Database Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  dump_database_schema \\\n  dbname='username_example_db'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/dump_database_schema?dbname=username_example_db","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_dump_database_schema.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_dump_database_schema.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/Mysql/,\n    q/dump_database_schema/,\n    {\n        'dbname' => 'username_example_db',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_dump_database_schema.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_dump_database_schema.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    'Mysql',\n    'dump_database_schema',\n    array (\n        'dbname' => 'username_example_db',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"description":"The string to give to MySQL.","example":"-- MySQL dump 10.13  Distrib 5.7.26, for Linux (x86_64)\n--\n-- Host: localhost    Database:username_example_db\n-- ------------------------------------------------------\n-- Serverversion\t5.7.26\n\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT*/;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n/*!40101 SET@OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n/*!40101 SET NAMES utf8mb4*/;\n/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n/*!40103 SET TIME_ZONE='+00:00'*/;\n/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n/*!40014 SET@OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n/*!40101 SET@OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n/*!40111 SE@OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n\n--\n-- Current Database:`username_example_db`\n--\n\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ `username_example_d/*!40100 DEFAULT CHARACTER SET latin1 */;\n\nUSE `username_example_db`;\n/*!40103 SETTIME_ZONE=@OLD_TIME_ZONE */;\n\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n/*!40014 SETFOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS*/;\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n/*!40101 SETCHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n/*!40101 SETCOLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES*/;\n\n-- Dump completed on 2019-06-06  9:44:04\n","type":"string"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}}},"module":{"type":"string","description":"The name of the module called.","example":"Mysql"},"func":{"type":"string","description":"The name of the method called.","example":"dump_database_schema"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"dump_database_schema","description":"This function returns a string that you can give to MySQL® to recreate a particular database’s schema.\n\n**Important:**\n\n  When you disable the [MySQL/MariaDB role](https://go.cpanel.net/serverroles) **and** remote MySQL is **not** configured, the system **disables** this function.","parameters":[{"name":"dbname","in":"query","required":"true","description":"The database's name.","schema":{"type":"string","example":"username_example_db"}}]}}},"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / Database Management","name":"Database Management"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"openapi":"3.0.2"},"check_database":{"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"name":"Database Management","description":"MySQL and MariaDB / Database Management"}],"paths":{"/Mysql/check_database":{"get":{"parameters":[{"required":"true","in":"query","name":"name","schema":{"example":"example_test","type":"string"},"description":"The database's name."}],"operationId":"Mysql-check_database","description":"This function checks for errors in all of the tables in a MySQL® database.\n\n**Important:**\n\nWhen you disable the [MySQL role](https://go.cpanel.net/serverroles) **and**\nremote MySQL is **not** already configured, the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"check_database","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"description":"An array that contains a response message for each of a database's tables in sequence.","items":{"properties":{"msg_type":{"description":"The type of message.\n* `status`\n* `error`\n* `info`\n* `note`\n* `warning`\n\n**Note:**\n\nFor more information, read [MySQL's `CHECK TABLE` documentation](http://dev.mysql.com/doc/refman/5.7/en/check-table.html).","example":"status","enum":["status","error","info","note","warning"],"type":"string"},"table":{"description":"The table's name.","example":"table1","type":"string"},"msg_text":{"type":"string","example":"OK","description":"The message's contents."}},"type":"object"},"type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"warnings":{"nullable":"true","description":"List of warnings generated by the API.\nWarnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"Mysql","description":"The name of the module called."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  check_database \\\n  name='example_test'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/check_database?name=example_test","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_check_database.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_check_database.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/Mysql/,\n    q/check_database/,\n    {\n        'name' => 'example_test',\n    }\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_check_database.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_check_database.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    'Mysql',\n    'check_database',\n    array (\n        'name' => 'example_test',\n    )\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}"}],"tags":["Mysql","Database Management"],"summary":"Validate MySQL database integrity","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Database Management"],"name":"MySQL and MariaDB"}],"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features.\nUse this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"delete_database":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features.\nUse 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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"name":"Database Management","description":"MySQL and MariaDB / Database Management"}],"paths":{"/Mysql/delete_database":{"get":{"summary":"Delete MySQL database","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  delete_database \\\n  name='example'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/delete_database?name=example","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_delete_database.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_delete_database.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/Mysql/,\n    q/delete_database/,\n    {\n        'name' => 'example',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_delete_database.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_delete_database.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    'Mysql',\n    'delete_database',\n    array (\n        'name' => 'example',\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}"}],"tags":["Mysql","Database Management"],"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"metadata":{"properties":{}},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"data":{"nullable":"true","default":null,"type":"object"},"warnings":{"description":"List of warnings generated by the API.\nWarnings describe non-critical failures or\n other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"Mysql","description":"The name of the module called."},"func":{"description":"The name of the method called.","example":"delete_database","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"delete_database","description":"This function deletes a MySQL® database.\n\n**Important:**\n\nwhen you disable the [MySQL/MariaDB role](https://go.cpanel.net/serverroles#roles) **and**\nremote MySQL is **not** already configured, the system **disables** this function.","parameters":[{"required":"true","name":"name","in":"query","schema":{"type":"string","example":"example"},"description":"The database's name."}]}}},"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Database Management"]}]},"setup_db_and_user":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"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/","version":"11.115.0.9999"},"openapi":"3.0.2","x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Database Management"]}],"paths":{"/Mysql/setup_db_and_user":{"get":{"x-cpanel-available-version":"cPanel 11.116","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Mysql","description":"The name of the module called."},"result":{"properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"data":{"type":"object","properties":{"database_user_password":{"type":"string","format":"password","description":"A randomly generated password intended to be maximally randomized.","example":";1t/U:wnFkCRL9q68]/+<TX=.C#7]n"},"hostname":{"oneOf":[{"format":"hostname","example":"localhost","type":"string"},{"type":"string","example":"mysql.remote.server.tld","format":"hostname"}],"description":"The hostname to connect to from within the server to connect to the MySQL server"},"database":{"description":"The randomized name of the database created. This is normally prefixed with the account username and can also be prefixed with application prefix.","oneOf":[{"example":"cpuser_wp_gwl7vpix28owo855yjomc7rsghkbjv0d0kf45kcvzip9tyxw9kdd","format":"database name","type":"string"},{"type":"string","format":"database name","example":"cpuser_ljiupjkhrn6zs20c9glnms0xor8sx48fm4noohri07xdruj31q"}]},"database_user":{"description":"The randomized username assigned to the database. This is normally prefixed with the account username and can also be prefixed with application prefix.","oneOf":[{"format":"database username","example":"cpuser_wp_dji1jdt7nhjiwjcjju45","type":"string"},{"type":"string","example":"cpuser_dji1jdt7nhjiwjcjju45asd","format":"database username"}]},"port":{"description":"The port to connect to from within the server to connect to the MySQL server","format":"unix-port","example":"3306","type":"string"}}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"metadata":{"properties":{}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"setup_db_and_user","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function creates a randomly named MySQL® database and user. This allows a 3rdparty tool to create its own DB without needing any knowledge of cPanel internals such as quotas or other limits. These will simply be passed back as an error.\n\n**Important:**\n\n  When you disable the [MySQL/MariaDB role](https://go.cpanel.net/howtouseserverprofiles#roles) **and** remote MySQL is **not** already configured, the system **disables** this function.","operationId":"setup_db_and_user","parameters":[{"description":"An optional string to prepend to the randomly generated database name. This is in addition to the cPanel user which will appear prior to this. The prefix should be 6 characters or less and be only alphanumeric characters. WARNING: longer prexies lead to less entropy in the random username. Keep it short if you can!","schema":{"type":"string","example":"wp"},"in":"query","name":"prefix","required":"false"}],"x-cpanel-api-version":"UAPI","summary":"Create a randomly named MySQL username/database set.","tags":["Mysql","Database Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  setup_db_and_user \\\n  prefix='wp'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/setup_db_and_user?prefix=wp"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_setup_db_and_user.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_setup_db_and_user.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/Mysql/,\n    q/setup_db_and_user/,\n    {\n        'prefix' => 'wp',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_setup_db_and_user.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_setup_db_and_user.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    'Mysql',\n    'setup_db_and_user',\n    array (\n        'prefix' => 'wp',\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}"}]}}},"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"name":"Database Management","description":"MySQL and MariaDB / Database Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}]},"set_privileges_on_database":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Mysql/set_privileges_on_database":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"set_privileges_on_database","type":"string"},"module":{"description":"The name of the module called.","example":"Mysql","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"data":{"nullable":"true","default":null,"type":"object"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}}}}}}}}},"x-cpanel-available-version":"cPanel 11.44","parameters":[{"in":"query","name":"user","required":"true","description":"The database user's name.\n\n**Important:**\n\nIf database prefixing is enabled, you **must** prefix this value with the account prefix and an underscore (`_`). For example, for the `dbuser` user on the `user` cPanel account, pass in a value of `user_dbuser`.","schema":{"example":"cpuser_dbuser","type":"string"}},{"required":"true","name":"database","in":"query","schema":{"example":"cpuser_dbname","type":"string"},"description":"The database's name.\n\n**Important:**\n\nIf database prefixing is enabled, you **must** prefix this value with the account prefix and an underscore (`_`). For example, for the `db` database on the `user` cPanel account, pass in a value of `user_db`."},{"description":"* `ALL PRIVILEGES`\n* A comma-separated list of one or more of the following individual privileges:\n  * `ALTER`\n  * `ALTER ROUTINE`\n  * `CREATE`\n  * `CREATE ROUTINE`\n  * `CREATE TEMPORARY TABLES`\n  * `CREATE VIEW`\n  * `DELETE`\n  * `DROP`\n  * `EVENT`\n  * `EXECUTE`\n  * `INDEX`\n  * `INSERT`\n  * `LOCK TABLES`\n  * `REFERENCES`\n  * `SELECT`\n  * `SHOW VIEW`\n  * `TRIGGER`\n  * `UPDATE`\n\n**Note:**\n\n* This list replaces, rather than adds to, the existing privilege list.\n* In browser-based and command line calls, separate multiple values with `%2C` and replace spaces with `%20`.","schema":{"type":"string","example":"DELETE,UPDATE,CREATE,ALTER"},"name":"privileges","in":"query","required":"false"}],"operationId":"set_privileges_on_database","description":"This function sets a MySQL® database user's privileges.\n\n**Important:**\n\nWhen you disable the [*MySQL/MariaDB* role](https://go.cpanel.net/serverroles), **and** remote MySQL is **not** already configured, the system **disables** this function.","summary":"Update MySQL user privileges","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  set_privileges_on_database \\\n  user='cpuser_dbuser' \\\n  database='cpuser_dbname'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/set_privileges_on_database?user=cpuser_dbuser&database=cpuser_dbname","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_set_privileges_on_database.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_set_privileges_on_database.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/Mysql/,\n    q/set_privileges_on_database/,\n    {\n        'user' => 'cpuser_dbuser',\n        'database' => 'cpuser_dbname',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_set_privileges_on_database.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_set_privileges_on_database.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    'Mysql',\n    'set_privileges_on_database',\n    array (\n        'user' => 'cpuser_dbuser',\n        'database' => 'cpuser_dbname',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Mysql","User Management"]}}},"x-tagGroups":[{"tags":["User Management"],"name":"MySQL and MariaDB"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"description":"MySQL and MariaDB / User Management","name":"User Management"}]},"delete_host":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"description":"MySQL and MariaDB / Remote Databases","name":"Remote Databases"}],"paths":{"/Mysql/delete_host":{"get":{"parameters":[{"description":"The remote MySQL server's hostname, IP Address, or IP address range.\n\n**Note:**\nYou may use the following IP address formats:\n\n192.168.1.6 — IP address.\n192.168.%.% — Range with the percent (%) symbol as a wildcard.\n192.168.0.0/16 — Range in CIDR format.","schema":{"type":"string","example":"remote.example.com"},"in":"query","name":"host","required":"true"}],"operationId":"delete_host","description":"This function removes a remote MySQL® host's access to the account's databases.\n\n**Important:**\n\nWhen you disable the [MySQL role](https://go.cpanel.net/serverroles) and remote MySQL is not already configured, the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"delete_host","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"nullable":"true","default":null,"type":"object"},"metadata":{"properties":{}}}},"module":{"example":"Mysql","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.52","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  delete_host \\\n  host='remote.example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/delete_host?host=remote.example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_delete_host.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_delete_host.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/Mysql/,\n    q/delete_host/,\n    {\n        'host' => 'remote.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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_delete_host.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_delete_host.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    'Mysql',\n    'delete_host',\n    array (\n        'host' => 'remote.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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mysql","Remote Databases"],"summary":"Disable remote MySQL host access","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Remote Databases"]}]},"rename_user":{"x-tagGroups":[{"tags":["User Management"],"name":"MySQL and MariaDB"}],"paths":{"/Mysql/rename_user":{"get":{"x-cpanel-available-version":"cPanel 11.44","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"rename_user","type":"string"},"result":{"properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"data":{"default":null,"nullable":"true","type":"object"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"Mysql","type":"string"}}}}}}},"operationId":"rename_user","description":"This function renames a MySQL® database user.\n\n**Important:**\n\nWhen you disable the [MySQL role](https://go.cpanel.net/serverroles)\n and remote MySQL is **not** already configured,\n the system **disables** this function.","parameters":[{"schema":{"example":"dbuser","type":"string"},"description":"The user's current name.","required":"true","name":"oldname","in":"query"},{"name":"newname","in":"query","required":"true","description":"The user's new name.\n\nImportant:\n====\n\nTo learn more about database username limits, check your database type:\n\nMySQL 5.6\n----\n\nMySQL version 5.6 limits the database username to 16 characters. The server uses the first nine characters of this limit for the database prefix. The database prefix uses the cPanel account's username and an underscore (`_`). The server only applies the first eight characters of the cPanel account's username.\n\nFor example:\n\n* A `db_` database prefix allows MySQL usernames of up to 13 characters.\n* An `example_` database prefix allows MySQL usernames of up to eight characters.\n\nMySQL 5.7+\n----\n\nMySQL versions 5.7 and later limit the database username to 32 characters. The server uses the first nine characters of this limit for the database prefix. The database prefix uses the cPanel account's username and an underscore (`_`). The server only applies the first eight characters of the cPanel account's username.\n\nFor example:\n\n* A `db_` database prefix allows MySQL usernames of up to 29 characters.\n* An `example_` database prefix allows MySQL usernames of up to 24 characters.\n\nMariaDB\n----\n\nMariaDB limits the database username to 47 characters. The server uses the first nine characters of this limit for the database prefix. The database prefix uses the cPanel account's username and an underscore (`_`). The server only applies the first eight characters of the cPanel account's username.\n\nFor example:\n\n* A `db_` database prefix allows MariaDB usernames of up to 44 characters.\n* An `example_` database prefix allows MariaDB usernames of up to 39 characters.","schema":{"example":"mynewusername","type":"string"}}],"x-cpanel-api-version":"UAPI","summary":"Update MySQL username","tags":["Mysql","User Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  rename_user \\\n  oldname='dbuser' \\\n  newname='mynewusername'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/rename_user?oldname=dbuser&newname=mynewusername","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_rename_user.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_rename_user.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/Mysql/,\n    q/rename_user/,\n    {\n        'oldname' => 'dbuser',\n        'newname' => 'mynewusername',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_rename_user.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_rename_user.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    'Mysql',\n    'rename_user',\n    array (\n        'oldname' => 'dbuser',\n        'newname' => 'mynewusername',\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}"}]}}},"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"name":"User Management","description":"MySQL and MariaDB / User Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access\nand modify cPanel account data and settings. This function only returns\nmetadata.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2"},"get_restrictions":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/Mysql/get_restrictions":{"get":{"description":"This function lists a MySQL® database's name, username length restrictions, and database prefix.\n\n**Important:**\n\n  When you disable the [*MySQL/MariaDB* role](https://go.cpanel.net/serverroles)\n  **and** remote MySQL is **not** already configured, the system **disables** this function.","operationId":"get_restrictions","parameters":[],"x-cpanel-available-version":"cPanel 11.44","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_restrictions","description":"The name of the method called.","type":"string"},"result":{"properties":{"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"data":{"properties":{"max_username_length":{"type":"integer","minimum":"1","example":"16","description":"The maximum length of a MySQL database user's name."},"max_database_name_length":{"example":"64","description":"The maximum length of a MySQL database name.","minimum":"1","type":"integer"},"prefix":{"description":"The account's database prefix, if database prefixing is enabled.\n* If database prefixing is enabled, a string of up to the first eight characters of the cPanel account username, and an underscore (_).\n* If database prefixing is disabled, this is null.","example":"user_","nullable":"true","type":"string"}},"type":"object"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"description":"The name of the module called.","example":"Mysql","type":"string"}}}}}}},"tags":["Mysql","User Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  get_restrictions\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/get_restrictions"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_get_restrictions.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_get_restrictions.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/Mysql/,\n    q/get_restrictions/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_get_restrictions.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_get_restrictions.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    'Mysql',\n    'get_restrictions'\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","summary":"Return MySQL name length restrictions"}}},"x-tagGroups":[{"tags":["User Management"],"name":"MySQL and MariaDB"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"description":"MySQL and MariaDB / User Management","name":"User Management"}]},"get_server_information":{"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Database Information"]}],"paths":{"/Mysql/get_server_information":{"get":{"tags":["Mysql","Database Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  get_server_information\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/get_server_information"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_get_server_information.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_get_server_information.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/Mysql/,\n    q/get_server_information/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_get_server_information.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_get_server_information.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    'Mysql',\n    'get_server_information'\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","summary":"Return MySQL server host information and version","description":"This function returns information about the account's MySQL® host.\n\n**Important:**\n\n  When you disable the [MySQL role](https://go.cpanel.net/serverroles) **and** remote MySQL is **not** already configured, the system **disables** this function.","operationId":"get_server_information","parameters":[],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_server_information","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"type":"object","properties":{"version":{"example":"5.6.23","description":"The MySQL server's version.","type":"string"},"is_remote":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the host is a remote MySQL server.\n* `1` - Remote host.\n* `0` - Local host."},"host":{"description":"The MySQL server's hostname or IP address.","oneOf":[{"example":"192.0.2.1","format":"ipv4","type":"string"},{"format":"domain","example":"remote.example.com","type":"string"}]}}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null}},"type":"object"},"module":{"description":"The name of the module called.","example":"Mysql","type":"string"}}}}},"description":"HTTP Request was successful."}}}}},"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / Database Information","name":"Database Information"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"list_routines":{"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / User Management","name":"User Management"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["User Management"],"name":"MySQL and MariaDB"}],"paths":{"/Mysql/list_routines":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  list_routines\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/list_routines","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_list_routines.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_list_routines.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/Mysql/,\n    q/list_routines/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_list_routines.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_list_routines.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    'Mysql',\n    'list_routines'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mysql","User Management"],"summary":"Return MySQL user routines","x-cpanel-api-version":"UAPI","operationId":"list_routines","description":"This function returns a database user's MySQL® routines.\n\n**Important:**\n\n  When you disable the [MySQL/MariaDB role](https://go.cpanel.net/serverroles) **and**\n  remote MySQL is **not** configured, the system **disables** this function.","parameters":[{"required":"false","name":"database_user","in":"query","schema":{"type":"string","example":"db_user"},"description":"The database user for whom to return MySQL routines. If you don't specify a database user, this function returns the MySQL routines for all database users."}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"list_routines"},"module":{"description":"The name of the module called.","example":"Mysql","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"data":{"description":"An array of MySQL routines. If no routines exist, the function returns an empty array.","items":{"type":"string"},"example":["cptest_newdb.hello","cptest_newdb.my_routine"],"type":"array"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"}}}}}}},"description":"HTTP Request was successful."}}}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"revoke_access_to_database":{"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["User Management"]}],"paths":{"/Mysql/revoke_access_to_database":{"get":{"summary":"Remove MySQL user privileges","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  revoke_access_to_database \\\n  user='dbuser' \\\n  database='mydb'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/revoke_access_to_database?user=dbuser&database=mydb"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_revoke_access_to_database.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_revoke_access_to_database.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/Mysql/,\n    q/revoke_access_to_database/,\n    {\n        'user' => 'dbuser',\n        'database' => 'mydb',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_revoke_access_to_database.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_revoke_access_to_database.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    'Mysql',\n    'revoke_access_to_database',\n    array (\n        'user' => 'dbuser',\n        'database' => 'mydb',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mysql","User Management"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API.\nWarnings describe non-critical failures or\n other problematic conditions noted while running a API.","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"example":"Mysql","description":"The name of the module called.","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"revoke_access_to_database"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.44","parameters":[{"required":"true","name":"user","in":"query","schema":{"type":"string","example":"dbuser"},"description":"The database user's name.\n\n**Important:**\n\nIf database prefixing is enabled, you **must** prefix this value with the account\nprefix and an underscore (`_`).\n\nFor example, for the `dbuser` user on the `user` cPanel account, pass in a value\nof `user_dbuser`. "},{"schema":{"example":"mydb","type":"string"},"description":"The database's name.","required":"true","in":"query","name":"database"}],"description":"This function revokes a MySQL® database user's privileges.\n\n**Important:**\n\nWhen you disable the [MySQL role](https://go.cpanel.net/serverroles) **and**\nremote MySQL is **not** already configured, the system **disables** this function.","operationId":"revoke_access_to_database"}}},"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"name":"User Management","description":"MySQL and MariaDB / User Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access\nand modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"repair_database":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"name":"Database Management","description":"MySQL and MariaDB / Database Management"}],"paths":{"/Mysql/repair_database":{"get":{"description":"This function repairs all of the tables in a MySQL® database.\n\n**Important:**\n\nWhen you disable the [MySQL/MariaDB role](https://go.cpanel.net/serverroles)\n**and** remote MySQL is **not** already configured, the system **disables** this function.","operationId":"repair_database","parameters":[{"schema":{"type":"string","example":"example_db"},"description":"The database's name.","required":"true","in":"query","name":"name"}],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"Mysql","description":"The name of the module called.","type":"string"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"type":"array","items":{"type":"object","properties":{"msg_type":{"example":"status","enum":["status","error","info","note","warning"],"description":"The type of message.\n\n* `status`\n* `error`\n* `info`\n* `note`\n* `warning`\n\n**Note:**\n\nFor more information, read [MySQL's REPAIR TABLE](http://dev.mysql.com/doc/refman/5.7/en/repair-table.html) documentation.","type":"string"},"table":{"type":"string","description":"The table's name in the database.","example":"table1"},"msg_text":{"description":"The message's contents.","example":"OK","type":"string"}}},"description":"An array of objects containing a response message for each of a database's table in sequence."}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","example":"repair_database","description":"The name of the method called."}}}}},"description":"HTTP Request was successful."}},"tags":["Mysql","Database Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  repair_database \\\n  name='example_db'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/repair_database?name=example_db"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_repair_database.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_repair_database.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/Mysql/,\n    q/repair_database/,\n    {\n        'name' => 'example_db',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_repair_database.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_repair_database.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    'Mysql',\n    'repair_database',\n    array (\n        'name' => 'example_db',\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Repair MySQL database tables"}}},"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Database Management"]}],"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"list_users":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"x-tagGroups":[{"tags":["User Management"],"name":"MySQL and MariaDB"}],"paths":{"/Mysql/list_users":{"get":{"tags":["Mysql","User Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  list_users\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/list_users"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_list_users.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_list_users.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/Mysql/,\n    q/list_users/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_list_users.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_list_users.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    'Mysql',\n    'list_users'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return MySQL users","operationId":"Mysql-list_users","description":"This function lists an account's MySQL® database users.\n\n**Important:**\n\n  When you disable the [MySQL/MariaDB role](https://go.cpanel.net/serverroles) **and**\n  remote MySQL is **not** configured, the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"type":"array","items":{"properties":{"databases":{"type":"array","example":["user_database1","user_database2"],"description":"An array of databases that belong to the\ndatabase user.\n\n**Note:**\n\nIf no users are assigned to a database, the function returns\nan empty array.","items":{"type":"string"}},"user":{"example":"example_user1","description":"The database username.","type":"string"},"shortuser":{"type":"string","description":"The short version of the database username.","example":"user1"}},"type":"object"},"description":"An array of database information objects."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"},"module":{"example":"Mysql","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"list_users","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"description":"MySQL and MariaDB / User Management","name":"User Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}]},"create_database":{"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Database Management"]}],"paths":{"/Mysql/create_database":{"get":{"parameters":[{"in":"query","name":"name","required":"true","description":"The new database's name.","schema":{"example":"newdb","type":"string"}},{"required":"false","in":"query","name":"prefix-size","schema":{"enum":["8","16"],"example":"16","default":"16","type":"integer"},"description":"The desired prefix size."}],"operationId":"create_database","description":"This function creates a MySQL® database.\n\n**Important:**\n\n  When you disable the [MySQL/MariaDB role](https://go.cpanel.net/howtouseserverprofiles#roles) **and** remote MySQL is **not** already configured, the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"create_database"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"data":{"type":"object","nullable":"true","default":null},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{}},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"module":{"example":"Mysql","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.44","tags":["Mysql","Database Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  create_database \\\n  name='newdb'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/create_database?name=newdb","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_create_database.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_create_database.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/Mysql/,\n    q/create_database/,\n    {\n        'name' => 'newdb',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_create_database.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_create_database.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    'Mysql',\n    'create_database',\n    array (\n        'name' => 'newdb',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Create MySQL database"}}},"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"name":"Database Management","description":"MySQL and MariaDB / Database Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"set_password":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features.\nUse this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"name":"User Management","description":"MySQL and MariaDB / User Management"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["User Management"],"name":"MySQL and MariaDB"}],"paths":{"/Mysql/set_password":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  set_password \\\n  user='dbuser' \\\n  password='12345luggage'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/set_password?user=dbuser&password=12345luggage","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_set_password.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_set_password.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/Mysql/,\n    q/set_password/,\n    {\n        'user' => 'dbuser',\n        'password' => '12345luggage',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_set_password.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_set_password.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    'Mysql',\n    'set_password',\n    array (\n        'user' => 'dbuser',\n        'password' => '12345luggage',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mysql","User Management"],"summary":"Update MySQL user password","x-cpanel-api-version":"UAPI","description":"This function sets a MySQL® database user's password.\n\n**Important:**\n\nWhen you disable the [MySQL role](https://go.cpanel.net/serverroles)\n and remote MySQL is **not** already configured,\n the system **disables** this function.","operationId":"Mysql-set_password","parameters":[{"schema":{"type":"string","example":"dbuser"},"description":"The MySQL database user.","required":"true","name":"user","in":"query"},{"required":"true","in":"query","name":"password","schema":{"type":"string","example":"12345luggage"},"description":"The user's new password."}],"x-cpanel-available-version":"cPanel 11.44","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"set_password","type":"string"},"result":{"properties":{"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"properties":{"failures":{"type":"array","description":"An array of the function's error messages.","items":{"type":"object","properties":{"error":{"description":"The error message.","type":"string"},"host":{"description":"The hostname that reported the error.","format":"domain","type":"string"}}}}},"type":"object"},"metadata":{"properties":{}},"warnings":{"nullable":"true","description":"List of warnings generated by the API.\nWarnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","example":"Mysql","description":"The name of the module called."}}}}}}}}}}},"delete_user":{"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / User Management","name":"User Management"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["User Management"]}],"paths":{"/Mysql/delete_user":{"get":{"x-cpanel-available-version":"cPanel 11.52","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"delete_user","type":"string"},"result":{"properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"data":{"default":null,"nullable":"true","type":"object"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"Mysql","description":"The name of the module called.","type":"string"}}}}}}},"description":"This function deletes a MySQL® user.\n\n**Important:**\n\nWhen you disable the [MySQL role](https://go.cpanel.net/serverroles) and remote MySQL is not already configured, the system **disables** this function.","operationId":"Mysql::delete_user","parameters":[{"schema":{"type":"string","example":"example"},"description":"The MySQL user's name.","required":"true","name":"name","in":"query"}],"x-cpanel-api-version":"UAPI","summary":"Delete MySQL user","tags":["Mysql","User Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  delete_user \\\n  name='example'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/delete_user?name=example"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_delete_user.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_delete_user.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/Mysql/,\n    q/delete_user/,\n    {\n        'name' => 'example',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_delete_user.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_delete_user.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    'Mysql',\n    'delete_user',\n    array (\n        'name' => 'example',\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"list_databases":{"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Database Management"]}],"paths":{"/Mysql/list_databases":{"get":{"parameters":[],"operationId":"list_databases","description":"This function lists an account's MySQL® databases.\n\n**Important:**\n\nWhen you disable the [*MySQL/MariaDB* role](https://go.cpanel.net/serverroles) **and** remote MySQL is **not** configured, the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Mysql"},"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1","type":"integer"},"data":{"type":"array","description":"Information about the database.","items":{"type":"object","properties":{"users":{"description":"A list of database usernames.\n\n**Note:**\n\nIf no users exist on a database, the function returns an empty array.","items":{"type":"string"},"example":["db_user","db2_user"],"type":"array"},"disk_usage":{"example":"673","description":"The disk space that the database uses, in bytes.","type":"integer","minimum":"0"},"database":{"type":"string","example":"user_db","description":"The database name."}}}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","example":"list_databases","description":"The name of the method called."}}}}}}},"x-cpanel-available-version":"cPanel 82","tags":["Mysql","Database Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  list_databases\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/list_databases","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_list_databases.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_list_databases.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/Mysql/,\n    q/list_databases/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_list_databases.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_list_databases.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    'Mysql',\n    'list_databases'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return MySQL databases"}}},"tags":[{"description":"The Mysql module for UAPI.","name":"Mysql"},{"description":"MySQL and MariaDB / Database Management","name":"Database Management"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"openapi":"3.0.2"},"add_host":{"paths":{"/Mysql/add_host":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Mysql"},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"type":"object","default":null,"nullable":"true"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API.\nWarnings describe non-critical failures or\n other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"func":{"type":"string","description":"The name of the method called.","example":"add_host"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.52","parameters":[{"in":"query","name":"host","required":"true","example":"192.168.1.6","description":"The remote MySQL server's hostname or IP address.\n\nYou may use the following IP address formats:\n\n* `192.168.1.6` — IP address.\n* `192.168.%.%` — Range with the percent (%) symbol as a wildcard.\n* `192.168.0.0/16` — Range in CIDR format.","schema":{"oneOf":[{"example":"192.168.1.6","format":"ipv4","type":"string"},{"example":"remote.example.com","format":"domain","type":"string"},{"type":"string","description":"IP address range with the percent (%) symbol as a wildcard.","example":"192.168.%.%"},{"example":"192.168.0.0/16","description":"IP address range in CIDR format.","type":"string"}]}}],"operationId":"add_host","description":"This function authorizes a remote MySQL® host to access the account's databases.\n\n**Important:**\n\nWhen you disable the [MySQL role](https://go.cpanel.net/serverroles)\n and remote MySQL is **not** already configured,\n the system **disables** this function.","summary":"Enable remote MySQL host access","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Mysql \\\n  add_host \\\n  host='192.168.1.6'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Mysql/add_host?host=192.168.1.6"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Mysql_add_host.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Mysql_add_host.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/Mysql/,\n    q/add_host/,\n    {\n        'host' => '192.168.1.6',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Mysql_add_host.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Mysql_add_host.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    'Mysql',\n    'add_host',\n    array (\n        'host' => '192.168.1.6',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Mysql","Remote Databases"]}}},"x-tagGroups":[{"name":"MySQL and MariaDB","tags":["Remote Databases"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"name":"Mysql","description":"The Mysql module for UAPI."},{"name":"Remote Databases","description":"MySQL and MariaDB / Remote Databases"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features.\nUse this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"}},"WebDisk":{"delete_user":{"x-tagGroups":[{"tags":["WebDisk Settings"],"name":"Files"}],"paths":{"/WebDisk/delete_user":{"get":{"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"delete_user","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"data":{"default":null,"nullable":"true","type":"object"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"WebDisk"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function deletes a Web Disk account.\n\n**Important:**\n\nWhen you disable the [Web Disk role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"WebDisk::delete_user","parameters":[{"required":"true","in":"query","name":"user","schema":{"type":"string","format":"email","example":"example1@example.com"},"description":"The Web Disk account username."},{"name":"destroy","in":"query","required":"true","description":"Whether to recursively delete the Web Disk account's folder and all of its contents.\n\n* `1` - Delete the folder for the Web Disk account\n* `0` - Do **not** delete the folder for the Web Disk account.","schema":{"type":"integer","example":"1","enum":["0","1"]}}],"x-cpanel-api-version":"UAPI","summary":"Delete Web Disk account","tags":["WebDisk","WebDisk Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WebDisk \\\n  delete_user \\\n  user='example1@example.com' \\\n  destroy='1'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/WebDisk/delete_user?user=example1%40example.com&destroy=1"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WebDisk_delete_user.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WebDisk_delete_user.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/WebDisk/,\n    q/delete_user/,\n    {\n        'user' => 'example1@example.com',\n        'destroy' => '1',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WebDisk_delete_user.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WebDisk_delete_user.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    'WebDisk',\n    'delete_user',\n    array (\n        'user' => 'example1@example.com',\n        'destroy' => '1',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"tags":[{"name":"WebDisk","description":"The WebDisk module for UAPI."},{"description":"Files / WebDisk Settings","name":"WebDisk Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"set_password":{"paths":{"/WebDisk/set_password":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WebDisk \\\n  set_password \\\n  user='example1@example.com' \\\n  password='123456luggage'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WebDisk/set_password?user=example1%40example.com&password=123456luggage"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WebDisk_set_password.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WebDisk_set_password.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/WebDisk/,\n    q/set_password/,\n    {\n        'user' => 'example1@example.com',\n        'password' => '123456luggage',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WebDisk_set_password.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WebDisk_set_password.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    'WebDisk',\n    'set_password',\n    array (\n        'user' => 'example1@example.com',\n        'password' => '123456luggage',\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["WebDisk","WebDisk Settings"],"summary":"Update Web Disk account password","x-cpanel-api-version":"UAPI","parameters":[{"in":"query","name":"user","required":"true","description":"The Web Disk account username.","schema":{"type":"string","example":"example1@example.com","format":"email"}},{"description":"The Web Disk account's password.","schema":{"type":"string","example":"123456luggage"},"name":"password","in":"query","required":"true"},{"in":"query","name":"enabledigest","required":"false","description":"Whether to enable Digest Authentication.\n\n* `1` - Enable Digest Authentication.\n* `0` - Disable Digest Authentication.","schema":{"type":"integer","default":"0","example":"0","enum":["0","1"]}}],"operationId":"WebDisk::set_password","description":"This function changes the Web Disk account's password.\n\n**Important:**\n\nWhen you disable the [Web Disk role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"set_password","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"WebDisk"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"default":null,"nullable":"true","type":"object"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}}}}}},"x-cpanel-available-version":"cPanel 54"}}},"x-tagGroups":[{"name":"Files","tags":["WebDisk Settings"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"description":"The WebDisk module for UAPI.","name":"WebDisk"},{"name":"WebDisk Settings","description":"Files / WebDisk Settings"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"set_permissions":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/WebDisk/set_permissions":{"get":{"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WebDisk \\\n  set_permissions \\\n  user='example1@example.com' \\\n  perms='rw'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WebDisk/set_permissions?user=example1%40example.com&perms=rw","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WebDisk_set_permissions.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WebDisk_set_permissions.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/WebDisk/,\n    q/set_permissions/,\n    {\n        'user' => 'example1@example.com',\n        'perms' => 'rw',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WebDisk_set_permissions.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WebDisk_set_permissions.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    'WebDisk',\n    'set_permissions',\n    array (\n        'user' => 'example1@example.com',\n        'perms' => 'rw',\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}"}],"tags":["WebDisk","WebDisk Settings"],"summary":"Update Web Disk home directory permissions","x-cpanel-api-version":"UAPI","operationId":"set_permissions","description":"This function changes the Web Disk home directory's permissions.\n\n**Important:**\n\nWhen you disable the [Web Disk role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"description":"The Web Disk account's username.","schema":{"format":"email","example":"example1@example.com","type":"string"},"name":"user","in":"query","required":"true"},{"in":"query","name":"perms","required":"true","description":"The Web Disk account's home directory file permissions.\n\n* `ro` — Read-only permissions.\n* `rw` — Read and write permissions.","schema":{"type":"string","enum":["ro","rw"],"example":"rw"}}],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"set_permissions","description":"The name of the method called.","type":"string"},"module":{"example":"WebDisk","description":"The name of the module called.","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["WebDisk Settings"],"name":"Files"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The WebDisk module for UAPI.","name":"WebDisk"},{"name":"WebDisk Settings","description":"Files / WebDisk Settings"}]},"set_homedir":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"name":"WebDisk","description":"The WebDisk module for UAPI."},{"description":"Files / WebDisk Settings","name":"WebDisk Settings"}],"paths":{"/WebDisk/set_homedir":{"get":{"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"set_homedir"},"result":{"properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"WebDisk"}}}}}}},"operationId":"WebDisk::set_homedir","description":"This function changes the home directory for a Web Disk account.\n\n**Important:**\n\nWhen you disable the [Web Disk role](https://go.cpanel.net/serveroles), the system **disables** this function.","parameters":[{"name":"user","in":"query","required":"true","description":"The Web Disk account username.","schema":{"example":"example1@example.com","format":"email","type":"string"}},{"required":"true","in":"query","name":"homedir","schema":{"type":"string","format":"path","example":"example1/"},"description":"The Web Disk account's home directory."},{"schema":{"example":"0","enum":["0","1"],"default":"0","type":"integer"},"description":"Whether to set the Web Disk directory's permissions to public or private.\n\n* `1` - Private (`0700`)\n* `0` - Public (`0755`)","required":"false","in":"query","name":"private"}],"x-cpanel-api-version":"UAPI","summary":"Update Web Disk home directory location","tags":["WebDisk","WebDisk Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WebDisk \\\n  set_homedir \\\n  user='example1@example.com' \\\n  homedir='example1/'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WebDisk/set_homedir?user=example1%40example.com&homedir=example1%2f"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WebDisk_set_homedir.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WebDisk_set_homedir.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/WebDisk/,\n    q/set_homedir/,\n    {\n        'user' => 'example1@example.com',\n        'homedir' => 'example1/',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WebDisk_set_homedir.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WebDisk_set_homedir.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    'WebDisk',\n    'set_homedir',\n    array (\n        'user' => 'example1@example.com',\n        'homedir' => 'example1/',\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}"}]}}},"x-tagGroups":[{"tags":["WebDisk Settings"],"name":"Files"}],"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}},"EmailAuth":{"apply_dmarc":{"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel."},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"paths":{"/EmailAuth/apply_dmarc":{"get":{"x-cpanel-api-version":"UAPI","summary":"Apply DMARC records to domains.","tags":["EmailAuth","Email DNS Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  apply_dmarc \\\n  domain='example.com' \\\n  policy='v=DMARC1; p=reject;'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/apply_dmarc?domain=example.com&policy='v=DMARC1; p=reject;'"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_apply_dmarc.live.pl and put this code into that file.\n# 5) In your browser log in to a cPanel account.\n# 6) Manually change the url from: .../frontend/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_apply_dmarc.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/EmailAuth/,\n    q/apply_dmarc/,\n    {\n        'domain' => 'example.com',\n        'policy' => 'v=DMARC1; p=reject;'\n    }\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_apply_dmarc.live.php and put this code into that file.\n// 5) In your browser log in to a cPanel account.\n// 6) Manually change the url from: .../frontend/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_apply_dmarc.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    'EmailAuth',\n    'apply_dmarc',\n    array (\n        'domain' => 'example.com',\n        'policy' => 'v=DMARC1; p=reject;'\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"apply_dmarc","description":"The name of the method called."},"module":{"description":"The name of the module called.","example":"EmailAuth","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"type":"array","description":"An array that contains information about the DMARC records applied to domains.","items":{"properties":{"msg":{"type":"string","description":"The domain's DMARC record status message.","example":"[ADD:TXT@_dmarc.example.com:v=DMARC1; p=reject;]"},"status":{"enum":["0","1"],"example":"1","description":"Whether the system applied a DMARC record to the domain.\n* `1` - Applied.\n* `0` - The system did **not** apply a DMARC record.","type":"integer"},"domain":{"example":"example.com","format":"domain","description":"The domain for which the DMARC record was applied.","type":"string"}},"type":"object"}},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"}},"type":"object"}},"type":"object"}}}}},"x-cpanel-available-version":"124","parameters":[{"examples":{"single":{"summary":"Enable a single domain's DMARC records.","value":"example.com"},"multiple":{"value":"domain-1=example1.com domain-2=example2.com domain-3=example3.com","summary":"Enable multiple domains' DMARC records."},"multiple-alternative":{"summary":"Enable multiple domains' DMARC records.","value":"domain=example1.com domain=example2.com domain=example3.com"}},"description":"The domain for which to apply the DMARC record.\n\n**Note:**\n\nTo enable multiple domain DMARC records, duplicate or increment the parameter. For example, to enable DMARC records for three domains, perform either of the following actions:\n\n* Use the `domain` parameter three times.\n* Use the `domain`, `domain-1`, and `domain-2` parameters.\n\nIf you do not include this argument, the system applies the DMARC record to all the user's domains.\n\nYou cannot use this function to edit temporary domains' DMARC records.","schema":{"type":"string","format":"domain"},"name":"domain","in":"query","required":"false"},{"required":"true","in":"query","name":"policy","schema":{"type":"string"},"description":"The DMARC record to apply to the requested domains.\n\n**Note:**\n\nVisit the following link for more information about the DMARC record specification: https://dmarc.org/resources/specification/","example":"v=DMARC1;p=reject;pct=100;rua=mailto:postmaster@example.com"}],"description":"This function applies a DMARC record to the specified domain(s)","operationId":"EmailAuth::apply_dmarc"}}},"x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"openapi":"3.0.2","info":{"version":"11.123.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"validate_current_spfs":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"paths":{"/EmailAuth/validate_current_spfs":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"EmailAuth","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"data":{"description":"A list of information about a domain's SPF records.","items":{"type":"object","properties":{"error":{"type":"string","description":"A message that details the reason why the DNS lookup failed.\n\n**Note:**\n\n The function **only** returns this value when the `state` return is the `ERROR` value.","example":"(XID rm8h9f) DNS returned SERVFAIL (code 2)\nin response to the systems query for example2.coms\nTXT records."},"ip_version":{"description":"The IP address version.\n* `4`\n* `6`","enum":["4","6"],"example":"6","type":"integer"},"ip_address":{"example":"0:0:0:0:0:ffff:c0a8:101","description":"The domain's IP address.","type":"string"},"state":{"type":"string","description":"The SPF record's status:\n* `VALID` - A single `SPF TXT` record exists in the domain's DNS with the correct `ip_address` value or redirect mechanism.\n* `MISMATCHED` - An `SPF TXT` record exists for the domain that does **not** match the `ip_address` value.\n* `MULTIPLE` - Multiple `SPF TXT` records exist in the domain's DNS.\n* `MISSING` - No `SPF TXT` record exists for the domain's DNS.\n* `ERROR` - The record's DNS lookup failed. The function returns the reason in the error return.","enum":["VALID","MISMATCHED","MULTIPLE","MISSING","ERROR"],"example":"VALID"},"records":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string","example":"'example.com: Sender\nis not authorized by default to use ''example.com''\nin ''helo'' identity, however domain is not\ncurrently prepared for false failures (mechanism\n''~all'' matched)'","description":"The reason why the SPF record is **not** correct, if one exists.\n\n**Note:**\n\nIf no errors exist, the function does **not** return this value."},"current":{"example":"v=spf1 +a +mx ip6:0:0:0:0:0:ffff:c0a8:101 ~all","description":"The SPF record's contents.","type":"string"},"state":{"description":"The SPF record's status:\n* `PASS` - The `SPF` record confirms that the `ip_address` value is a valid sender.\n* `NEUTRAL` - The current `SPF` record configuration does not determine the `ip_address` value's validity.\n* `FAIL` - The `SPF` record states that the `ip_address` value is **not** a valid sender.\n* `SOFTFAIL` - The `SPF` record states that the `ip_address` value is **not** a valid sender, but does not `FAIL` state it.\n* `TEMPERROR` - The `SPF` record check resulted in a failure. For example, a network failure.\n* `PERMERROR` - The domain's `SPF` records are **incorrect** and require manual correction.\n\n**Note:**\n\nThese values correspond with [RFC7208 section 2.6](https://tools.ietf.org/html/rfc7208#section-2.6).","example":"PASS","enum":["PASS","NEUTRAL","FAIL","SOFTFAIL","TEMPERROR","PERMERROR"],"type":"string"}}},"description":"The SPF records of the domain's DNS."},"domain":{"type":"string","example":"example.com","description":"The queried domain.","format":"domain"},"expected":{"description":"The SPF record for the domain in the DNS.","example":"ip6:0:0:0:0:0:ffff:c0a8:101","type":"string"}}},"type":"array"},"status":{"type":"integer","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"metadata":{"properties":{}}}},"func":{"type":"string","example":"validate_current_spfs","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 78","parameters":[{"required":"true","name":"domain","in":"query","schema":{"format":"domain","type":"string"},"description":"The domain for which to check the `SPF` records.","examples":{"multiple":{"value":"`domain`=example.com,`domain`=another.com,`domain`=yetanother.com\n`domain`=example.com,`domain-1`=another.com,`domain-2`=yetanother.com","summary":"Check `SPF` records for a multiple domains."},"single":{"summary":"Check `SPF` records for a single domain.","value":"example.com"}}}],"description":"This function retrieves the the Sender Policy Framework (SPF) records\nfor one or more domains.","operationId":"validate_current_spfs","summary":"Validate domains' SPF records","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  validate_current_spfs \\\n  domain='example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/validate_current_spfs?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_validate_current_spfs.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_validate_current_spfs.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/EmailAuth/,\n    q/validate_current_spfs/,\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    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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_validate_current_spfs.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_validate_current_spfs.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    'EmailAuth',\n    'validate_current_spfs',\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    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}"}],"tags":["EmailAuth","Email DNS Settings"]}}},"tags":[{"name":"EmailAuth","description":"The EmailAuth module for UAPI."},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}]},"validate_current_ptrs":{"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"paths":{"/EmailAuth/validate_current_ptrs":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"validate_current_ptrs","description":"The name of the method called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"data":{"type":"array","description":"An array that contains information about the account's PTR records.","items":{"properties":{"error":{"type":"string","example":"1.1.1.1.1 is not a valid IP address.","description":"A mmessage that details the reason why the domain's IP address validation failed.\n\n**Note:**\n\nThe function only returns this value when the `state` returned is\nthe `ERROR` value."},"ptr_records":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string","description":"The fully-qualified domain name (FQDN)\nthat a PTR record points to.","format":"domain","example":"example.com"},"forward_records":{"type":"array","description":"A list of IP addresses that the domain\nresolves to for A (IPv4) and AAAA (IPv6) records.","items":{"example":"10.0.0.1","type":"string"}},"state":{"description":"The state of the domain's PTR record.\n* `VALID` - The PTR record is valid.\n* `MISSING_FWD` - The PTR points to a domain without an A or AAAA record.\n* `FWD_MISMATCH` - The PTR record points to a domain without an A or AAAA record that points back to the IP address.","example":"VALID","enum":["VALID","MISSING_FWD","FWD_MISMATCH"],"type":"string"}}},"description":"The domain's PTR records.\n\n**Note:**\n\nThe function does **not** return this for a domain with an invalid IP address."},"ip_version":{"description":"The IP version number.\n* 4\n* 6\n\n**Note:**\n\nThe function does **not** return this value for a domain with an invalid IP address.","enum":["4","6"],"example":"4","type":"integer"},"helo":{"type":"string","format":"domain","description":"The hostname that the domain uses to identify\nitself to remote SMTP servers. A valid hostname.","example":"example.com"},"ip_address":{"description":"The IP address.\n\n**Note:**\n\nThe function does **not** return this value for a domain with an invalid IP address.","example":"10.0.0.1","type":"string"},"state":{"description":"Whether the PTR records are valid for the domain.\n* `ERROR` - The domain's IP address is invalid. The function returns the reason in the error return.\n* `IP_IS_PRIVATE` - The IP address exists within a range of private IP addresses.\n* `VALID` - The PTR record is valid.\n* `MISSING_PTR` - No PTR records exist for the IP address.\n* `PTR_MISMATCH` - One or more PTR records point to a domain that does not point back to the correct IP address.\n\n**Note:**\n\n* DNS does not define PTR records for private IP addresses.\n* The function only returns a VALID response if all of an IP address's PTR records are valid.","enum":["ERROR","IP_IS_PRIVATE","VALID","MISSING_PTR","PTR_MISMATCH"],"example":"VALID","type":"string"},"arpa_domain":{"example":"1.0.0.10.in-addr.arpa","description":"The IP address used to perform a reverse DNS (rDNS) lookup.\nFor more information about rDNS, read our\n[How to Configure Reverse DNS for BIND in WHM](https://go.cpanel.net/HowtoConfigureReverseDNSforBINDinWHM)\ndocumentation.\nA valid reversed IP address appended with one of the following:\n* in-addr.arpa - An IPv4 address.\n* ip6.arpa - An IPv6 address.\n\nFor information about .arpa domains, read Wikipedia's\n[Reverse DNS lookup](https://en.wikipedia.org/wiki/Reverse_DNS_lookup)\narticle.\n\n**Note:**\n\nThe function does not return this value for a domain with an invalid IP address.","type":"string"},"domain":{"example":"example.com","description":"The queried domain.","format":"domain","type":"string"},"nameservers":{"type":"array","items":{"format":"domain","example":"ns1.example.com","type":"string"},"description":"The authoritative nameservers for the domain's PTR record."}},"type":"object"}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}},"type":"object"},"module":{"type":"string","example":"EmailAuth","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 78","parameters":[{"name":"domain","in":"query","required":"true","description":"The domain for which to validate the PTR records.","examples":{"single":{"summary":"Check PTR records for a single domain.","value":"example.com"},"multiple":{"value":"`domain`=example.com,`domain`=another.com,`domain`=yetanother.com\n`domain`=example.com,`domain-1`=another.com,`domain-2`=yetanother.com","summary":"Check PTR records for a multiple domains."}},"schema":{"format":"domain","type":"string"}}],"description":"This function validates the pointer records (PTR) for IPv4 and\nIPv6 addresses that the account's domains send mail from. It retrieves the\nPTR records for each IP address and determines which of the domain's IP addresses\nsend mail. It then validates the PTR records for each IP address and validates\nthe A or AAAA records pointing to each domain. This function also ensures\nthat at least one of that domain's A or AAAA records points back to the IP\naddress.","operationId":"validate_current_ptrs","summary":"Validate domains' PTR records","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  validate_current_ptrs \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/validate_current_ptrs?domain=example.com","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_validate_current_ptrs.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_validate_current_ptrs.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/EmailAuth/,\n    q/validate_current_ptrs/,\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    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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_validate_current_ptrs.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_validate_current_ptrs.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    'EmailAuth',\n    'validate_current_ptrs',\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    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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["EmailAuth","Email DNS Settings"]}}},"x-tagGroups":[{"name":"DNS","tags":["Email DNS Settings"]}],"openapi":"3.0.2","info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"remove_dmarc":{"paths":{"/EmailAuth/remove_dmarc":{"get":{"x-cpanel-api-version":"UAPI","summary":"Remove DMARC record from domain(s)","tags":["EmailAuth","Email DNS Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  remove_dmarc \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/remove_dmarc?domain=example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_remove_dmarc.live.pl and put this code into that file.\n# 5) In your browser log in to a cPanel account.\n# 6) Manually change the url from: .../frontend/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_remove_dmarc.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/EmailAuth/,\n    q/remove_dmarc/,\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    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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_remove_dmarc.live.php and put this code into that file.\n// 5) In your browser log in to a cPanel account.\n// 6) Manually change the url from: .../frontend/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_remove_dmarc.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    'EmailAuth',\n    'remove_dmarc',\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    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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-available-version":"124","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"EmailAuth","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"data":{"items":{"type":"object","properties":{"domain":{"description":"The domain for which the DMARC record was removed.","format":"domain","example":"example.com","type":"string"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the system removed the domain's DMARC record.\n* `1` - The system removed the domain's DMARC record.\n* `0` - The system did **not** remove the domain's DMARC record."},"msg":{"type":"string","description":"Information about the removed DMARC record.","example":"[REMOVE:TXT@_dmarc.example.com:v=DMARC1; p=reject;]"}}},"description":"An array of objects that contain information about the removed DMARC records.","type":"array"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"func":{"description":"The name of the method called.","example":"remove_dmarc","type":"string"}},"type":"object"}}}}},"operationId":"EmailAuth::remove_dmarc","description":"This function removes the DMARC record for domains.","parameters":[{"required":"false","in":"query","name":"domain","schema":{"type":"string"},"description":"The domain from which to remove the DMARC record.\n\n**Note:**\n\nIf you do not include this argument, the system will remove **all** DMARC records from **all** domains owned by the user.\n\nTo remove multiple domain DMARC records, duplicate the parameter name. For example, use the `domain=example.com`, `domain=example2.com`, and `domain=example3.com` parameters.\n\nYou **cannot** remove DMARC records on temporary domains.","examples":{"multiple":{"value":"domain=example.com&domain=example2.com&domain=example.com","summary":"Multiple domains."},"single":{"value":"example.com","summary":"A single domain."}}}]}}},"x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel."}},"description":"A server running cPanel."}],"tags":[{"name":"EmailAuth","description":"The EmailAuth module for UAPI."},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"version":"11.123.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"disable_dkim":{"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"paths":{"/EmailAuth/disable_dkim":{"get":{"description":"This function removes the DomainKeys Identified Mail (DKIM) records on the DNS server for one or more domains.","operationId":"disable_dkim","parameters":[{"schema":{"type":"string"},"examples":{"multiple":{"summary":"Multiple domains.","value":"domain=example.com&domain=example2.com&domain=example.com"},"single":{"value":"example.com","summary":"A single domain."}},"description":"The domain for which to remove DKIM records on the DNS server.\n\n**Note:**\n\nTo remove multiple domain DKIM records, duplicate the parameter name. For example, use the `domain=example.com`, `domain=example2.com`, and `domain=example3.com` parameters.","required":"true","name":"domain","in":"query"}],"x-cpanel-available-version":"cPanel 78","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"disable_dkim","description":"The name of the method called."},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"description":"An array of objects that contain information about the removal of a domain's DKIM record on the DNS server.","items":{"type":"object","properties":{"domain":{"type":"string","example":"example.com","format":"domain","description":"The domain for which the system removed the DKIM record."},"msg":{"example":"[REMOVE:TXT@default._domainkey:v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiLMNOpQDw5nw4NP1RsWXlfmiMzByDfOT16QCZO/xJtrPZKskZF8/sU0zWGTqKUOErlyJfoJzMDUv3/zzjGswc2nEmYqxxoQZaBkN4QaS6MvJQxysAr+sK8C248/r9zMperQdhJedUVejtpFQHJwgqpHy1tQMxY37L7sQjdxmQ5WnQ1acXiwIDAQAB\\;]","description":"Information about the removed DKIM record.","type":"string"},"status":{"enum":["0","1"],"example":"1","description":"Whether the system removed the domain's DKIM record on the DNS server.\n* `1` - The system removed the domain's DKIM record.\n* `0` - The system did **not** remove the domain's DKIM record.","type":"integer"}}},"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"EmailAuth","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"tags":["EmailAuth","Email DNS Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  disable_dkim \\\n  domain='example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/disable_dkim?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_disable_dkim.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_disable_dkim.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/EmailAuth/,\n    q/disable_dkim/,\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    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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_disable_dkim.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_disable_dkim.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    'EmailAuth',\n    'disable_dkim',\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    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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Remove domains' DKIM records"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}}},"install_dkim_private_keys":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/EmailAuth/install_dkim_private_keys":{"get":{"summary":"Add domains' DKIM record keys","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  install_dkim_private_keys \\\n  domain='example' \\\n  key='-----BEGIN%20RSA%20PRIVATE%20KEY-----%0aAAAAB3NzaC1yc2EAAAABIwAAAQEA5kSivOqhs0U9ZMN20nxFe27QZ3t0lT2zbH7OSXylKd%0a1rjAjYXGnSXC9j2uaZlemHlptBKVziMJC86ha7Hcj6dVOVrDQ6vF4q34bOCjtKLphQ0IjB%0azVIvqILH9eLJdRaOrS34CmgmPaisrCk5wKVlakygvUfcj3HzaTKS6THyZDGx5shdTpa9lb%0ay8tpOD3JceV7ay4w8r0DipoKPC0OLpvS4EABEeMo9sx8zQEaKv03XygjNCCYtFvxlQQIRG%0alVoL7mPaHSaL3anI05RpNbm/PS+9BhZg+BqNjU4ofHBbfkXk5MiN6M7ieR4Sk5BquccboG%0aF13U5slNgmCEekdt0amw%0a-----END%20RSA%20PRIVATE%20KEY-----%0a'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/install_dkim_private_keys?domain=example&key=-----BEGIN%2520RSA%2520PRIVATE%2520KEY-----%250aAAAAB3NzaC1yc2EAAAABIwAAAQEA5kSivOqhs0U9ZMN20nxFe27QZ3t0lT2zbH7OSXylKd%250a1rjAjYXGnSXC9j2uaZlemHlptBKVziMJC86ha7Hcj6dVOVrDQ6vF4q34bOCjtKLphQ0IjB%250azVIvqILH9eLJdRaOrS34CmgmPaisrCk5wKVlakygvUfcj3HzaTKS6THyZDGx5shdTpa9lb%250ay8tpOD3JceV7ay4w8r0DipoKPC0OLpvS4EABEeMo9sx8zQEaKv03XygjNCCYtFvxlQQIRG%250alVoL7mPaHSaL3anI05RpNbm%2fPS%2b9BhZg%2bBqNjU4ofHBbfkXk5MiN6M7ieR4Sk5BquccboG%250aF13U5slNgmCEekdt0amw%250a-----END%2520RSA%2520PRIVATE%2520KEY-----%250a","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_install_dkim_private_keys.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_install_dkim_private_keys.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/EmailAuth/,\n    q/install_dkim_private_keys/,\n    {\n        'domain' => 'example',\n        'key' => '-----BEGIN%20RSA%20PRIVATE%20KEY-----%0aAAAAB3NzaC1yc2EAAAABIwAAAQEA5kSivOqhs0U9ZMN20nxFe27QZ3t0lT2zbH7OSXylKd%0a1rjAjYXGnSXC9j2uaZlemHlptBKVziMJC86ha7Hcj6dVOVrDQ6vF4q34bOCjtKLphQ0IjB%0azVIvqILH9eLJdRaOrS34CmgmPaisrCk5wKVlakygvUfcj3HzaTKS6THyZDGx5shdTpa9lb%0ay8tpOD3JceV7ay4w8r0DipoKPC0OLpvS4EABEeMo9sx8zQEaKv03XygjNCCYtFvxlQQIRG%0alVoL7mPaHSaL3anI05RpNbm/PS+9BhZg+BqNjU4ofHBbfkXk5MiN6M7ieR4Sk5BquccboG%0aF13U5slNgmCEekdt0amw%0a-----END%20RSA%20PRIVATE%20KEY-----%0a',\n    }\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_install_dkim_private_keys.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_install_dkim_private_keys.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    'EmailAuth',\n    'install_dkim_private_keys',\n    array (\n        'domain' => 'example',\n        'key' => '-----BEGIN%20RSA%20PRIVATE%20KEY-----%0aAAAAB3NzaC1yc2EAAAABIwAAAQEA5kSivOqhs0U9ZMN20nxFe27QZ3t0lT2zbH7OSXylKd%0a1rjAjYXGnSXC9j2uaZlemHlptBKVziMJC86ha7Hcj6dVOVrDQ6vF4q34bOCjtKLphQ0IjB%0azVIvqILH9eLJdRaOrS34CmgmPaisrCk5wKVlakygvUfcj3HzaTKS6THyZDGx5shdTpa9lb%0ay8tpOD3JceV7ay4w8r0DipoKPC0OLpvS4EABEeMo9sx8zQEaKv03XygjNCCYtFvxlQQIRG%0alVoL7mPaHSaL3anI05RpNbm/PS+9BhZg+BqNjU4ofHBbfkXk5MiN6M7ieR4Sk5BquccboG%0aF13U5slNgmCEekdt0amw%0a-----END%20RSA%20PRIVATE%20KEY-----%0a',\n    )\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}"}],"tags":["EmailAuth","Email DNS Settings"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"items":{"type":"object","properties":{"msg":{"example":"[ADD:TXT@default._domainkey:v=DKIM1; k=rsa; p=AAAAB3NzaC1yc2EAAAABIwAAAQEA5kSivOqhs0U9ZMN20nxFe27QZ3t0lT2zbH7OSXylKd1rjAjYXGnSXC9j2uaZlemHlptBKVziMJC86ha7Hcj6dVOVrDQ6vF4q34bOCjtKLphQ0IjBzVIvqILH9eLJdRaOrS34CmgmPaisrCk5wKVlakygvUfcj3HzaTKS6THyZDGx5shdTpa9lby8tpOD3JceV7ay4w8r0DipoKPC0OLpvS4EABEeMo9sx8zQEaKv03XygjNCCYtFvxlQQIRGlVoL7mPaHSaL3anI05RpNbm/PS+9BhZg+BqNjU4ofHBbfkXk5MiN6M7ieR4Sk5BquccboGF13U5slNgmCEekdt0amw;]","description":"The DKIM private key's installation status message.","type":"string"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the system installed the DKIM private key to the local server.\n* `1` - The system installed the DKIM private key.\n* `0` - The system **cannot** install the DKIM private key."},"domain":{"format":"domain","description":"The DKIM private key's associated domain.","example":"example.com","type":"string"}}},"description":"An array of objects that contains information about the DKIM private key installation to the local server.","type":"array"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"EmailAuth","type":"string"},"func":{"type":"string","example":"install_dkim_private_keys","description":"The name of the method called."}}}}}}},"x-cpanel-available-version":"cPanel 78","parameters":[{"in":"query","name":"domain","required":"true","description":"The domain for which to install a DKIM private key on the local server.\n\n**Note:**\n\nTo install multiple RSA private keys for multiple domains, duplicate the parameter name. For example, use the `domain=example.com`, `domain=example2.com`, and `domain=example3.com` parameters.","examples":{"single":{"value":"example","summary":"A single domain."},"multiple":{"summary":"Multiple domains.","value":"domain=example&domain=example2.com&domain=example3.com"}},"schema":{"type":"string","format":"domain"}},{"description":"An RSA key in [Privacy-Enhanced Mail (PEM)](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.\n\n**Note:**\n\nYou **must** provide this parameter for each `domain` parameter.","schema":{"example":"-----BEGIN%20RSA%20PRIVATE%20KEY-----%0aAAAAB3NzaC1yc2EAAAABIwAAAQEA5kSivOqhs0U9ZMN20nxFe27QZ3t0lT2zbH7OSXylKd%0a1rjAjYXGnSXC9j2uaZlemHlptBKVziMJC86ha7Hcj6dVOVrDQ6vF4q34bOCjtKLphQ0IjB%0azVIvqILH9eLJdRaOrS34CmgmPaisrCk5wKVlakygvUfcj3HzaTKS6THyZDGx5shdTpa9lb%0ay8tpOD3JceV7ay4w8r0DipoKPC0OLpvS4EABEeMo9sx8zQEaKv03XygjNCCYtFvxlQQIRG%0alVoL7mPaHSaL3anI05RpNbm/PS+9BhZg+BqNjU4ofHBbfkXk5MiN6M7ieR4Sk5BquccboG%0aF13U5slNgmCEekdt0amw%0a-----END%20RSA%20PRIVATE%20KEY-----%0a","format":"pem-private-key","type":"string"},"in":"query","name":"key","required":"true"}],"operationId":"install_dkim_private_keys","description":"This function installs existing keys for use in a DomainKeys Identified Mail (DKIM) record. This is useful if you do not want the system to generate keys for DKIM records.\n\n**Note:**\n\n* This function does **not** update the local DNS server's records.\n* If the local DNS server is authoritative for the domain's DNS records, use the UAPI `EmailAuth::enable_dkim` function to update the local DNS server's DNS records.\n  * We recommend that you use the UAPI `EmailAuth::install_dkim_private_keys` and `EmailAuth::enable_dkim functions` in a batch UAPI call."}}},"x-tagGroups":[{"name":"DNS","tags":["Email DNS Settings"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}]},"validate_current_dkims":{"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"paths":{"/EmailAuth/validate_current_dkims":{"get":{"summary":"Validate domains' DKIM records","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  validate_current_dkims \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/validate_current_dkims?domain=example.com","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_validate_current_dkims.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_validate_current_dkims.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/EmailAuth/,\n    q/validate_current_dkims/,\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    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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_validate_current_dkims.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_validate_current_dkims.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    'EmailAuth',\n    'validate_current_dkims',\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    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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["EmailAuth","Email DNS Settings"],"x-cpanel-available-version":"cPanel 78","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"EmailAuth","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"data":{"items":{"properties":{"error":{"type":"string","description":"A message that details the reason why the DNS lookup failed.\n\n**Note:**\n\nThe function only returns this value when the `state` returned\nis the `ERROR` value.","example":"(XID 4krw35) DNS returned SERVFAIL (code 2)\nin response to the systems query for default._domainkey.example2.coms\nTXT records."},"state":{"example":"VALID","enum":["VALID","MALFORMED","MISMATCH","MISSING","MULTIPLE","NOPUB","ERROR"],"description":"The domain's DKIM record status.\nPossible values:\n\n* `VALID` The DKIM record is valid.\n* `MALFORMED` A single DKIM record exists, but the record does not match the expected DKIM specifications.\n* `MISMATCH` A DKIM record exists, but it does not match the expected public key.\n* `MISSING` No DKIM record exists for the domain.\n* `MULTIPLE` Multiple DKIM records exist.\n* `NOPUB` No key exists on the local server for the domain.\n* `ERROR` The record's DNS lookup failed. The function returns the reason in the error return.","type":"string"},"domain":{"type":"string","example":"default._domainkey.example.com","format":"domain","description":"The domain that the function used to check\nthe DKIM record. This will be the value of\nthe domain parameter with a `default._domainkey` prefix."},"records":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","description":"The DKIM TXT record's status:\n* `VALID` - The DKIM TXT record matches the local server's public key.\n* `MISMATCH` - The DKIM TXT record does not match the local server's public key.\n* `PERMFAIL` - Multiple DKIM TXT records for the domain exist or a misconfigured DKIM TXT record exists.","enum":["VALID","MISMATCH","PERMFAIL"],"example":"VALID"},"reason":{"description":"The reason why the DKIM TXT record is not correct, if one exists.\n\n**Note:**\n\nThis function **only** returns this value when the `state` value is `PERMFAIL`.","example":"example.com: The DKIM version must be \"DKIM1\".","type":"string"},"current":{"description":"The domain's DKIM TXT record data contents.\n\n**Important:**\n\n This function may fail to preserve whitespace in DKIM records.","example":"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDw5nw4NP1RsWXlfmiMzByDfOT16QCZO\\/xJtrPZKskZF8\\/sU0zWGTqKUOErlyJfoJzMDUv3\\/zzjGswc2nEmYqxxoQZaBkN4QaS6MvJQxysAr+sK8C248\\/r9zMperQdhJedUVejtpFQHJwgqpHy1tQMxY37L7sQjdxmQ5WnQ1acXiwIDAQAB","type":"string"}}},"description":"The domain's DNS DKIM TXT records.\n\n**Important:**\n\nThis function may fail to preserve whitespace in DKIM records."},"validity_cache_update":{"type":"string","description":"The result of the DKIM record's validity cache update operation:\n* `set` The domain is invalid but passed its validity check. The validity check now passes the domain as valid.\n* `unset` The domain is invalid and did not pass its validity check. The validity check does not pass the domain as valid.\n* `valid` The domain is valid and passed its validity check. There are no changes required.\n* `invalid` The domain is invalid and failed its validity check. There are no changes required.\n* `none` The domain is invalid, but the system will not take further action.\n* `error` The domain's validity check operation failed.","enum":["set","unset","valid","invalid","none","error"],"example":"valid"},"expected":{"type":"string","example":"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDw5nw4NP1RsWXlfmiMzByDfOT16QCZO\\/xJtrPZKskZF8\\/sU0zWGTqKUOErlyJfoJzMDUv3\\/zzjGswc2nEmYqxxoQZaBkN4QaS6MvJQxysAr+sK8C248\\/r9zMperQdhJedUVejtpFQHJwgqpHy1tQMxY37L7sQjdxmQ5WnQ1acXiwIDAQAB","description":"The DKIM record's contents."}},"type":"object"},"description":"An array that contains information about the\ndomain's DKIM records. ","type":"array"},"status":{"type":"integer","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}},"type":"object"},"func":{"example":"validate_current_dkims","description":"The name of the method called.","type":"string"}}}}}}},"description":"This function retrieves and checks the DomainKeys Identified Mail\n(DKIM) records for one or more domains.","operationId":"validate_current_dkims","parameters":[{"in":"query","name":"domain","required":"true","examples":{"single":{"summary":"Check DKIM records for a single domain.","value":"example.com"},"multiple":{"summary":"Check DKIM records for a multiple domains.","value":"domain=example.com,domain=another.com,domain=yetanother.com\ndomain=example.com,domain-1=another.com,domain-2=yetanother.com"}},"description":"The domain for which to check the DKIM records.","schema":{"type":"string","format":"domain"}}]}}},"x-tagGroups":[{"name":"DNS","tags":["Email DNS Settings"]}],"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"ensure_dkim_keys_exist":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"description":"DNS / Email DNS Settings","name":"Email DNS Settings"}],"paths":{"/EmailAuth/ensure_dkim_keys_exist":{"get":{"x-cpanel-api-version":"UAPI","summary":"Validate domains' DKIM private keys","tags":["EmailAuth","Email DNS Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  ensure_dkim_keys_exist \\\n  domain='example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/ensure_dkim_keys_exist?domain=example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_ensure_dkim_keys_exist.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_ensure_dkim_keys_exist.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/EmailAuth/,\n    q/ensure_dkim_keys_exist/,\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    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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_ensure_dkim_keys_exist.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_ensure_dkim_keys_exist.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    'EmailAuth',\n    'ensure_dkim_keys_exist',\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    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-available-version":"cPanel 78","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"ensure_dkim_keys_exist","description":"The name of the method called."},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"type":"array","items":{"type":"object","properties":{"domain":{"example":"example.com","format":"domain","description":"The domain for which the system confirmed that a valid DKIM key exists.","type":"string"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the system verified that the domain's DKIM key exists.\n* `1` - The system verified the existence of the domain's DKIM key.\n* `0` - The system did **not** verify the existence of the domain's DKIM key."},"msg":{"example":"created new key","description":"The domain's DKIM key status message.","type":"string"}}},"description":"An array of objects that contains information about the domain's DKIM key validity."},"metadata":{"properties":{}}},"type":"object"},"module":{"example":"EmailAuth","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"description":"This function confirms the validity of a DomainKeys Identified Mail (DKIM) key for one or more domains.\n\n**Notes:**\n\n* If an existing DKIM key does **not** meet the server's security requirements, the system replaces the existing DKIM key.\n* If no DKIM key exists, the system creates a new key for the domain.","operationId":"ensure_dkim_keys_exist","parameters":[{"name":"domain","in":"query","required":"true","description":"The domain for which to confirm a valid DKIM key exists.\n\n**Note:**\n\n To check the DKIM key validity for multiple domains, duplicate the parameter name. For example, use the `domain=example.com`, `domain=example2.com`, and `domain=example3.com` parameters.","examples":{"multiple":{"summary":"Multiple domains.","value":"domain=example.com&domain=example2.com&domain=example3.com"},"single":{"summary":"A single domain.","value":"example.com"}},"schema":{"type":"string","format":"domain"}}]}}},"x-tagGroups":[{"name":"DNS","tags":["Email DNS Settings"]}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"enable_dkim":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"paths":{"/EmailAuth/enable_dkim":{"get":{"description":"This function enables DomainKeys Identified Mail (DKIM) records on the DNS server for one or more domains.\n\n**Note:**\n\nIf a DKIM record does **not** exist on the server, this function will install a new DKIM record.","operationId":"enable_dkim","parameters":[{"examples":{"single":{"value":"example.com","summary":"Enable a single domain's DKIM records."},"multiple-alternative":{"value":"domain=example1.com domain=example2.com domain=example3.com","summary":"Enable multiple domains' DKIM records."},"multiple":{"summary":"Enable multiple domains' DKIM records.","value":"domain-1=example1.com domain-2=example2.com domain-3=example3.com"}},"description":"The domain for which to enable DKIM records on the DNS server.\n\n**Note:**\n\nTo enable multiple domain DKIM records, duplicate or increment the parameter. For example, to perform this for three domains, you could:\n\n* Use the `domain` parameter multiple times.\n* Use the `domain`, `domain-1`, and `domain-2` parameters.","schema":{"format":"domain","type":"string"},"in":"query","name":"domain","required":"true"}],"x-cpanel-available-version":"cPanel 78","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string","example":"example.com","format":"domain","description":"The domain for which the system enabled the DKIM record."},"status":{"description":"Whether the system enabled the domain's DKIM record on the DNS server.\n* `1` - Enabled.\n* `0` - The system did **not** enable the domain's DKIM record.","example":"1","enum":["0","1"],"type":"integer"},"msg":{"example":"[no changes needed]","description":"The domain's DKIM record status message.","type":"string"}}},"description":"An array that contains information about the enabled state of a domain's DKIM records on the DNS server."}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"EmailAuth","type":"string"},"func":{"example":"enable_dkim","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"tags":["EmailAuth","Email DNS Settings"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  enable_dkim \\\n  domain='example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/enable_dkim?domain=example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_enable_dkim.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_enable_dkim.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/EmailAuth/,\n    q/enable_dkim/,\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    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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_enable_dkim.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_enable_dkim.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    'EmailAuth',\n    'enable_dkim',\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    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","summary":"Enable domains' DKIM records"}}},"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"description":"DNS / Email DNS Settings","name":"Email DNS Settings"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}]},"validate_current_dmarcs":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.123.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel.","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"paths":{"/EmailAuth/validate_current_dmarcs":{"get":{"parameters":[{"description":"The domain for which to check the DMARC record.\n\n**Note:**\n\nIf you do not include this argument, the system will validate DMARC records for all domains owned by the user.","examples":{"multiple":{"summary":"Check DMARC records for multiple domains.","value":"domain=example.com,domain=another.com,domain=yetanother.com"},"single":{"value":"domain=example.com","summary":"Check DMARC records for a single domain."}},"schema":{"type":"string","format":"domain"},"name":"domain","in":"query","required":"false"}],"operationId":"EmailAuth::validate_current_dmarcs","description":"This function checks the validity of the current DMARC record for one or more domains.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"EmailAuth"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"data":{"type":"array","items":{"properties":{"subdomain":{"type":"string","description":"The domain that the function used to check\nthe DMARC record. This will be the value of\nthe `domain` parameter with a `_dmarc` prefix.","format":"domain","example":"_dmarc.example.com"},"domain":{"example":"example.com","format":"domain","description":"The target domain of the DMARC policy.","type":"string"},"error":{"example":"(XID 4krw35) DNS returned SERVFAIL (code 2)\nin response to the system's query for _dmarc.example.com\nTXT records.","description":"A message that details either why the DNS lookup failed, or if there is a SPF/DKIM failure.\n\n**Note:**\n\nThis will be set to `MALFORMED` if there is a syntax issue with this domain's SPF and DKIM records.","type":"string"},"record":{"type":"string","description":"The domain's DMARC TXT record.","example":"v=DMARC1; p=none;"},"state":{"type":"string","description":"The domain's DMARC record status.\nPossible values:\n\n* `VALID` - A DMARC policy is set for the domain, along with valid SPF and DKIM records for the domain and IP address.\n* `MALFORMED` - A DMARC record is set, but it did not pass a syntax check.\n* `DKIM_SPF_ERROR` - A DMARC record exists; however, both the DKIM and SPF records for this domain did not pass validation.\n* `DKIM_ERROR` - A DMARC record exists; however, the DKIM record for this domain did not pass validation.\n* `SPF_ERROR` - A DMARC record exists; however, the SPF record for this domain did not pass validation.\n* `MISSING` - No DMARC record exists for the domain at the DMARC subdomain location.\n* `DNS_ERROR` - A DNS error prevented validation of the DMARC record.","enum":["VALID","MALFORMED","DKIM_SPF_ERROR","DKIM_ERROR","SPF_ERROR","MISSING","DNS_ERROR"],"example":"VALID"},"suggested":{"type":"string","description":"The recommended DMARC policy.","example":"v=DMARC1; p=none;"}},"type":"object"},"description":"An array that contains information about the\ndomain's DMARC records. "},"status":{"enum":["0","1"],"example":"1","description":"- `1` - Success.\n- `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null,"nullable":"true"}}},"func":{"type":"string","description":"The name of the method called.","example":"validate_current_dmarcs"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 124","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  validate_current_dmarcs \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/validate_current_dmarcs?domain=example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_validate_current_dmarcs.live.pl and put this code into that file.\n# 5) In your browser log in to a cPanel account.\n# 6) Manually change the url from: .../frontend/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_validate_current_dmarcs.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/EmailAuth/,\n    q/validate_current_dmarcs/,\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    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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_validate_current_dmarcs.live.php and put this code into that file.\n// 5) In your browser log in to a cPanel account.\n// 6) Manually change the url from: .../frontend/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_validate_current_dmarcs.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    'EmailAuth',\n    'validate_current_dmarcs',\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    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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["EmailAuth","Email DNS Settings"],"summary":"Validate domains' DMARC records","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"DNS","tags":["Email DNS Settings"]}]},"install_spf_records":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"paths":{"/EmailAuth/install_spf_records":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  install_spf_records \\\n  domain='example.com' \\\n  record='\"v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all\"'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/install_spf_records?domain=example.com&record=%22v%3dspf1%20ip4%3a10.0.0.1%20%252Ba%20%252Bmx%20%252Bip4%3a10.0.0.2%20%252Bip4%3a10.0.0.3%20-all%22"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_install_spf_records.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_install_spf_records.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/EmailAuth/,\n    q/install_spf_records/,\n    {\n        'domain' => 'example.com',\n        'record' => '\"v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all\"',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_install_spf_records.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_install_spf_records.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    'EmailAuth',\n    'install_spf_records',\n    array (\n        'domain' => 'example.com',\n        'record' => '\"v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all\"',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["EmailAuth","Email DNS Settings"],"summary":"Add domains' SPF records","x-cpanel-api-version":"UAPI","operationId":"install_spf_records","description":"This function installs a Sender Policy Framework (SPF) record for a domain on the DNS server.","parameters":[{"required":"true","name":"domain","in":"query","schema":{"type":"string"},"description":"The domain for which to install an SPF record on the DNS server.\n\n**Note:**\n\nTo install multiple SPF records, duplicate the parameter name. For example, use the `domain=example.com`, `domain=example2.com`, and `domain=example3.com` parameters.","examples":{"multiple":{"summary":"Multiple domains.","value":"domain=example.com&domain=example2.com&domain=example3.com"},"single":{"value":"example.com","summary":"A single domain."}}},{"required":"true","name":"record","in":"query","schema":{"type":"string","example":"\"v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all\""},"description":"An SPF record.\n\n**Note:**\n\nYou **must** provide this parameter for each `domain` parameter."}],"x-cpanel-available-version":"cPanel 78","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"array","description":"An array of objects that contains information about the domain's SPF record installation to the DNS server.","items":{"properties":{"msg":{"description":"The SPF record's installation status to the DNS server.","example":"[ADD:TXT@example.com.:v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all]","type":"string"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the system installed the SPF record to the DNS server.\n- `1` - The system installed the SPF record on the DNS server.\n- `0` - The system **cannot** install the SPF record on the DNS server."},"domain":{"description":"The SPF record's associated domain on the DNS server.","format":"domain","example":"example.com","type":"string"}},"type":"object"}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","description":"- 1 - Success.\n- 0 - Failed. Check the `errors`  field for more details.","example":"1","enum":["0","1"]},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"EmailAuth"},"func":{"example":"install_spf_records","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}}}}},"tags":[{"description":"The EmailAuth module for UAPI.","name":"EmailAuth"},{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}]},"fetch_dkim_private_keys":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"EmailAuth","description":"The EmailAuth module for UAPI."},{"description":"DNS / Email DNS Settings","name":"Email DNS Settings"}],"paths":{"/EmailAuth/fetch_dkim_private_keys":{"get":{"tags":["EmailAuth","Email DNS Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  EmailAuth \\\n  fetch_dkim_private_keys \\\n  domain='example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/fetch_dkim_private_keys?domain=example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EmailAuth_fetch_dkim_private_keys.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/EmailAuth_fetch_dkim_private_keys.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/EmailAuth/,\n    q/fetch_dkim_private_keys/,\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    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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EmailAuth_fetch_dkim_private_keys.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/EmailAuth_fetch_dkim_private_keys.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    'EmailAuth',\n    'fetch_dkim_private_keys',\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    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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return domains' DKIM private keys","parameters":[{"in":"query","name":"domain","required":"true","examples":{"single":{"summary":"A single domain.","value":"example.com"},"multiple":{"value":"domain=example.com&domain=example2.com&domain=example3.com","summary":"Multiple domains."}},"description":"The domain for which to retrieve the installed DKIM private key.\n\n**Note:**\n\nTo retrieve multiple domain DKIM keys, duplicate the parameter name. For example, use the `domain=example.com`, `domain=example2.com`, and `domain=example3.com` parameters.","schema":{"format":"domain","type":"string"}}],"description":"This function returns a domain's installed DKIM private key in [Privacy-Enhanced Mail (PEM)](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.\n\n**Warning:**\n\nWe **strongly** recommend that you protect your private key. If others obtain your private DKIM key, they could sign emails and impersonate you as a sender.","operationId":"fetch_dkim_private_keys","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"fetch_dkim_private_keys","description":"The name of the method called.","type":"string"},"result":{"properties":{"data":{"items":{"type":"object","properties":{"domain":{"type":"string","example":"example.com","format":"domain","description":"The queried domain."},"pem":{"type":"string","example":"-----BEGIN RSA PRIVATE KEY-----\nMIICLDCCAdKgAwIBAgIBADAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0G\nA1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2VydGlmaWNhdGUgYXV0aG9y\naXR5MQ8wDQYDVQQIEwZMZXV2ZW4xJTAjBgNVBAMTHEdudVRMUyBjZXJ0aWZpY2F0\nZSBhdXRob3JpdHkwHhcNMTEwNTIzMjAzODIxWhcNMTIxMjIyMDc0MTUxWjB9MQsw\nCQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2Vy\ndGlmaWNhdGUgYXV0aG9yaXR5MQ8wDQYDVQQIEwZMZXV2ZW4xJTAjBgNVBAMTHEdu\ndVRMUyBjZXJ0aWZpY2F0ZSBhdXRob3JpdHkwWTATBgcqhkjOPQIBBggqhkjOPQMB\nBwNCAARS2I0jiuNn14Y2sSALCX3IybqiIJUvxUpj+oNfzngvj/Niyv2394BWnW4X\nuQ4RTEiywK87WRcWMGgJB5kX/t2no0MwQTAPBgNVHRMBAf8EBTADAQH/MA8GA1Ud\nDwEB/wQFAwMHBgAwHQYDVR0OBBYEFPC0gf6YEr+1KLlkQAPLzB9mTigDMAoGCCqG\nSM49BAMCA0gAMEUCIDGuwD1KPyG+hRf88MeyMQcqOFZD0TbVleF+UsAGQ4enAiEA\nl4wOuDwKQa+upc8GftXE2C//4mKANBC6It01gUaTIpo==\n-----END RSA PRIVATE KEY-----\n","description":"The domain's DKIM private key, in PEM format.","format":"pem-private-key"}}},"description":"An array of objects that contains information about the domain's DKIM private key.","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"EmailAuth","description":"The name of the module called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 78"}}},"x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"openapi":"3.0.2","info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}}},"Personalization":{"set":{"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Personalization","description":"The Personalization module for UAPI."}],"paths":{"/Personalization/set":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"set","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"example":{"milk":{"success":"1","value":"cold","reason":"OK"},"coffee":{"success":"1","value":"hot","reason":"OK"}},"type":"object","properties":{"personalization":{"description":"The saved NVData information stored on the server.\n\n**Note:**\n\nYou set this return's name based on the keys that you provide in the `personalization` parameter.","additionalProperties":{"type":"object","properties":{"success":{"enum":["0","1"],"example":"1","description":"Whether the function successfully saved the value on the server.\n  - `1` — Successful.\n  - `0` — Unsuccessful.","type":"integer"},"value":{"type":"string","nullable":"true","description":"The value stored for the associated NVData key, or a null value if the key does not exist in the store."},"reason":{"example":"OK","description":"The message that describes the failure if `success` returns `0`, or `OK` if `success` returns `1`.","type":"string"}}}}}},"status":{"type":"integer","description":"- `1` — Success\n- `0` — Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"module":{"description":"The name of the module called.","example":"Personalization","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 74","parameters":[],"operationId":"Personalization-set","description":"This function saves its data to an NVData file on disk. cPanel\nNVData is a per-account configuration storage mechanism that you can use to\nmaintain persistent cPanel & WHM settings across multiple sessions. This includes\ncustom settings for your own themes and plugins.\n\n**Note:**\n\nNVData keys and values are limited to 128 and 2048 bytes, respectively.","summary":"Save NVData data to file","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"echo '{\"personalization\":{\"coffee\":\"hot\",\"milk\":\"cold\"}}' | \\\nuapi --input=json --output=jsonpretty \\\n  --user=username \\\n  Personalization \\\n  set","lang":"Shell","label":"CLI"},{"label":"HTTP Request (Wire Format)","lang":"HTTP","source":"POST /cpsess##########/execute/Personalization/set HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 50\n\n{\"personalization\":{\"coffee\":\"hot\",\"milk\":\"cold\"}}"}],"tags":["Personalization"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"personalization":{"description":"The NVData keys and values to update.","type":"object","additionalProperties":{"type":"string"}}},"example":{"personalization":{"milk":"cold","coffee":"hot"}}}}},"required":"true"}}}},"x-tagGroups":[{"tags":["Personalization"],"name":"cPanel Account"}]},"get":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"name":"Personalization","description":"The Personalization module for UAPI."}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Personalization"],"name":"cPanel Account"}],"paths":{"/Personalization/get":{"post":{"summary":"Retrieve NVData data from file","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"echo '{\"names\":[\"coffee\",\"milk\"]}' | \\\nuapi --input=json --output=jsonpretty \\\n  --user=username \\\n  Personalization \\\n  get"},{"source":"POST /cpsess##########/execute/Personalization/get HTTP/1.1\nHost: example.com:2083\nCookie: ###################################\nContent-Type: application/json\nContent-Length: 27\n\n{\"names\":[\"coffee\",\"milk\"]}","label":"HTTP Request (Wire Format)","lang":"HTTP"}],"tags":["Personalization"],"requestBody":{"required":"true","content":{"application/json":{"schema":{"type":"object","properties":{"names":{"description":"List of NVData keys to query the server about.","items":{"type":"string"},"type":"array"}},"example":{"names":["coffee","milk"]}}}}},"x-cpanel-available-version":"cPanel 74","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get","description":"The name of the method called.","type":"string"},"module":{"type":"string","example":"Personalization","description":"The name of the module called."},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"example":{"coffee":{"reason":"OK","value":"hot","success":"1"},"milk":{"value":"cold","success":"1","reason":"OK"}},"type":"object","properties":{"personalization":{"description":"The retrieved NVData information stored on the server.\n\n**Note:**\n\n* You set this return's name based on the keys that you provide in the `personalization` parameter with the UAPI `Personalization::set` function.\n* This return's name is the NVData key's name.","additionalProperties":{"properties":{"reason":{"type":"string","description":"The message that describes the failure if `success` returns `0`, or `OK` if `success` returns `1`.","example":"OK"},"success":{"description":"Whether the function successfully retrieved the value from the server.\n  - `1` — Successful.\n  - `0` — Unsuccessful.","example":"1","enum":["0","1"],"type":"integer"},"value":{"type":"string","description":"The value stored for the associated NVData key, or a null value if the key does not exist in the store.","nullable":"true"}},"type":"object"}}}},"status":{"type":"integer","description":"- `1` — Success\n- `0` — Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}}}},"operationId":"Personalization::get","description":"This function retrieves the data from an NVData file on disk. cPanel\nNVData is a per-account configuration storage mechanism that you can use to\nmaintain persistent cPanel & WHM settings across multiple sessions. This includes\ncustom settings for your own themes and plugins.\n\n**Note:**\n\nNVData keys and values are limited to 128 and 2048 bytes, respectively.","parameters":[]}}}}},"BlockIP":{"add_ip":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"tags":[{"name":"BlockIP","description":"The BlockIP module for UAPI."},{"description":"Block Ip Addresses / Block IP","name":"Block IP"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"name":"Block Ip Addresses","tags":["Block IP"]}],"paths":{"/BlockIP/add_ip":{"get":{"operationId":"blockip-add-ip","description":"This function blocks IP addresses from accessing the domains on a cPanel account.\n\n**Important**\n\nWhen you disable the Web Server role, the system disables this function.","parameters":[{"description":"The IP address or IP address range that you wish to block.","examples":{"single-ipv4":{"value":"192.0.2.0","summary":"Single IPv4 Address"},"implied-range":{"value":"192.168.0.1-58","summary":"Implied Range"},"cidr-ipv6":{"value":"2001:db8::/32","summary":"CIDR Format IPv6"},"cidr-ipv4":{"value":"192.168.0.1/16","summary":"CIDR Format IPv4"},"single-ipv6":{"summary":"Single IPv6 Address","value":"2001:db8::1"},"ipv4-range":{"summary":"IPv4 Range","value":"192.168.0.1-192.168.0.58"},"hostname":{"value":"example.com","summary":"Add by resolving hostname"},"subnet-octet":{"summary":"Subnet Range - Matches 10.*.*.*","value":"10."},"ipv6-range":{"value":"2001:db8::1-2001:db8::3","summary":"IPv6 Range"}},"schema":{"type":"string"},"in":"query","name":"ip","required":"true"}],"x-cpanel-available-version":"82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"add_ip"},"module":{"type":"string","description":"The name of the module called.","example":"BlockIP"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"status":{"enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"description":"IP addresses that were added, as translated by the system.","items":{"type":"string","example":"1.1.1.1"},"nullable":"true","type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"}}}}}}},"tags":["BlockIP","Block IP"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BlockIP \\\n  add_ip \\\n  ip='192.168.0.1/16'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/BlockIP/add_ip?ip=192.168.0.1%2f16"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BlockIP_add_ip.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BlockIP_add_ip.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/BlockIP/,\n    q/add_ip/,\n    {\n        'ip' => '192.168.0.1/16',\n    }\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BlockIP_add_ip.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BlockIP_add_ip.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    'BlockIP',\n    'add_ip',\n    array (\n        'ip' => '192.168.0.1/16',\n    )\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","summary":"Add IP address to cPanel account's block list"}}}},"remove_ip":{"tags":[{"description":"The BlockIP module for UAPI.","name":"BlockIP"},{"description":"Block Ip Addresses / Block IP","name":"Block IP"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"name":"Block Ip Addresses","tags":["Block IP"]}],"paths":{"/BlockIP/remove_ip":{"get":{"description":"This function unblocks IP addresses from accessing domains on a cPanel account.\n\n**Important**\n\nWhen you disable the Web Server role, the system disables this function.","operationId":"blockip-remove-ip","parameters":[{"name":"ip","in":"query","required":"true","description":"The IP address or IP address range that you wish to unblock.","examples":{"single-ipv4":{"summary":"Single IPv4 Address","value":"192.0.2.0"},"implied-range":{"summary":"Implied Range","value":"192.168.0.1-58"},"cidr-ipv6":{"summary":"CIDR Format IPv6","value":"2001:db8::/32"},"cidr-ipv4":{"summary":"CIDR Format IPv4","value":"192.168.0.1/16"},"single-ipv6":{"value":"2001:db8::1","summary":"Single IPv6 Address"},"ipv4-range":{"value":"192.168.0.1-192.168.0.58","summary":"IPv4 Range"},"hostname":{"value":"example.com","summary":"Add by resolving hostname"},"subnet-octet":{"summary":"Subnet Range - Matches 10.*.*.*","value":"10."},"ipv6-range":{"summary":"IPv6 Range","value":"2001:db8::1-2001:db8::3"}},"schema":{"type":"string"}}],"x-cpanel-available-version":"82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"remove_ip","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"type":"array","items":{"type":"string","example":"1.1.1.1"},"description":"The IP addresses that the function removed, and the system translated.","nullable":"true"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"BlockIP"}},"type":"object"}}}}},"tags":["BlockIP","Block IP"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  BlockIP \\\n  remove_ip \\\n  ip='192.168.0.1/16'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/BlockIP/remove_ip?ip=192.168.0.1%2f16"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BlockIP_remove_ip.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/BlockIP_remove_ip.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/BlockIP/,\n    q/remove_ip/,\n    {\n        'ip' => '192.168.0.1/16',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BlockIP_remove_ip.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/BlockIP_remove_ip.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    'BlockIP',\n    'remove_ip',\n    array (\n        'ip' => '192.168.0.1/16',\n    )\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","summary":"Remove IP address from cPanel account's block list"}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"}}},"SSH":{"get_port":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/SSH/get_port":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"status":{"enum":["1","0"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"type":"object","properties":{"port":{"description":"The server's SSH port.","example":"22","type":"integer","maximum":"65535","minimum":"1"}}},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"SSH","type":"string"},"func":{"example":"get_port","description":"The name of the method called.","type":"string"}}}}}}},"description":"This function retrieves the server's SSH port.","operationId":"SSH-get_port","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return SSH port","tags":["SSH"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSH \\\n  get_port\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/SSH/get_port","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSH_get_port.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/SSH_get_port.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/SSH/,\n    q/get_port/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSH_get_port.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/SSH_get_port.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    'SSH',\n    'get_port'\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-tagGroups":[{"tags":["SSH"],"name":"Server Information"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"SSH","description":"The SSH module for UAPI."}]},"get_shell":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"version":"11.125.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/ssh/get_shell":{"get":{"x-cpanel-available-version":"cPanel 11.42","summary":"Return whether cPanel account has shell access","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_shell","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"properties":{"shell":{"type":"string","description":"The cPanel account's shell path.","example":"/bin/bash"},"has_terminal_access":{"example":"true","description":"Whether the cPanel account has shell access.\n\n* `true` - Account has shell access.\n* `false` - Account does not have shell access.\n","type":"boolean"}},"type":"object"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"example":"1","enum":["1","0"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"}}},"module":{"example":"SSH","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-api-version":"UAPI","description":"This function returns whether the cPanel account has shell access and the account's shell path.","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  SSH \\\n  get_shell\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/SSH/get_shell"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is wp-squared for WP Squared accounts.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file SSH_get_shell.live.pl and put this code into that file.\n# 5) In your browser login to a WP Squared account.\n# 6) Manually change the url from: .../frontend/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/SSH_get_shell.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to WP Squared - 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/SSH/,\n    q/get_shell/\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 WP Squared - 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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is wp-squared for WP Squared accounts.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file SSH_get_shell.live.php and put this code into that file.\n// 5) In your browser login to a WP Squared account.\n// 6) Manually change the url from: .../frontend/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/SSH_get_shell.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 WP Squared - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n    'SSH',\n    'get_shell'\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 WP Squared - 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","label":"LiveAPI PHP","lang":"PHP"}],"tags":["SSH"]}}},"x-tagGroups":[{"name":"Server Information","tags":["SSH"]}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The SSH module for UAPI.","name":"SSH"}]}},"WebVhosts":{"list_domains":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"description":"The WebVhosts module for UAPI.","name":"WebVhosts"},{"name":"Virtual Host Information","description":"Domain Management / Virtual Host Information"}],"paths":{"/WebVhosts/list_domains":{"get":{"x-cpanel-available-version":"cPanel 56","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"WebVhosts"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"data":{"items":{"properties":{"vhost_is_ssl":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether an SSL certificate secures the domain.\n* `1` - Secured.\n* `0` - **Not** secured."},"vhost_name":{"type":"string","example":"hostname.example.com","format":"domain","description":"The name of the virtual host."},"proxy_subdomains":{"type":"array","nullable":"true","items":{"type":"string"},"description":"An array of service subdomains (proxy subdomains) listed for the domain.\n\n**Note:**\n\nThis only returns values when `vhost_is_ssl` equals `1`.","example":["cpanel","webmail","autodiscover","whm","webdisk"]},"domain":{"type":"string","format":"domain","description":"The domain name.","example":"example.com"}},"type":"object"},"type":"array"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"}},"type":"object"},"func":{"example":"list_domains","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function lists virtual host names for each domain.","operationId":"WebVhosts::list_domains","parameters":[],"summary":"Return virtual host names for domains","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WebVhosts \\\n  list_domains\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WebVhosts/list_domains"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WebVhosts_list_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WebVhosts_list_domains.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/WebVhosts/,\n    q/list_domains/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WebVhosts_list_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WebVhosts_list_domains.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    'WebVhosts',\n    'list_domains'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["WebVhosts","Virtual Host Information"]}}},"x-tagGroups":[{"name":"Domain Management","tags":["Virtual Host Information"]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"list_ssl_capable_domains":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/WebVhosts/list_ssl_capable_domains":{"get":{"x-cpanel-available-version":"cPanel 64","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"list_ssl_capable_domains","type":"string"},"module":{"type":"string","example":"WebVhosts","description":"The name of the module called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"items":{"properties":{"vhost_name":{"format":"domain","description":"The name of the virtual host or website.","example":"hostname.example.com","type":"string"},"is_proxy":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the system automatically created the service subdomain or a user manually created the domain.\n* `1` - The system automatically created the service subdomain.\n* `0` - A user manually created the domain.\n\n**Note:**\n\nIf a user manually creates a subdomain that matches a preassigned subdomain (for example, cpanel or whm), then the function returns `0`."},"domain":{"type":"string","example":"example.com","format":"domain","description":"A valid domain name on the virtual host."}},"type":"object"},"description":"An array of objects containing data for a domain.","type":"array","properties":{}},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}},"type":"object"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"list_ssl_capable_domains","description":"This function lists every domain for which you may purchase an SSL certificate. The possible domains for the Secure Sockets Layer (SSL) certificate include applicable [service subdomains.](https://go.cpanel.net/ServiceProxySubdomains)","parameters":[{"required":"false","name":"hide_temporary_domains","in":"query","schema":{"default":"0","enum":["1","0"],"example":"1","type":"integer"},"description":"Whether to hide temporary domains from the returned values.\n* `1` — Return an error if the requested domain is a temporary domain.\n* `0` — Return all domains, including the temporary domains.\n**Note:**\n\nIf you set this parameter's value to `1` and the requested domain is temporary,\nthe function will return an error similar to the following example: `Domain [example.com] is a temporary\ndomain and `hide_temporary_domains` is enabled.`"}],"x-cpanel-api-version":"UAPI","summary":"Return domains that allow SSL certificate purchase","tags":["WebVhosts","Virtual Host Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WebVhosts \\\n  list_ssl_capable_domains\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WebVhosts/list_ssl_capable_domains","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WebVhosts_list_ssl_capable_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WebVhosts_list_ssl_capable_domains.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/WebVhosts/,\n    q/list_ssl_capable_domains/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WebVhosts_list_ssl_capable_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WebVhosts_list_ssl_capable_domains.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    'WebVhosts',\n    'list_ssl_capable_domains'\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"tags":["Virtual Host Information"],"name":"Domain Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The WebVhosts module for UAPI.","name":"WebVhosts"},{"name":"Virtual Host Information","description":"Domain Management / Virtual Host Information"}]}},"Batch":{"strict":{"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/Batch/strict":{"get":{"operationId":"strict","description":"This function combines calls for multiple UAPI functions and performs them in order.\n\n**Note:**\n\n* If a function call in the list fails, the `Batch::strict` function does not run further function calls in the list.\n* Due to the potential length of calls of this function, we recommend that you use the HTTP POST method for extremely long batch commands.","parameters":[{"description":"A UAPI function call, encoded as a JSON array with two or three items:\n\n* The UAPI module.\n* The UAPI function.\n* A JSON object containing the parameters to pass to this function. You can omit this value if you do not pass any parameters to the function.\n\nTo submit multiple commands, duplicate the parameter name, or index all parameter names and increment the index for each one.\n\n* When using the cPanel LiveAPI PHP Library, you **must** increment the parameter name when you submit the arguments in an associative array. For example: use `command-0`, `command-1`, and `command-2`.\n* When using the cPanel LiveAPI Perl Library, you **must** increment the parameter name when you submit the arguments in a hash. For example: use `command-0`, `command-1`, and `command-2`.\n* You do **not** need to add an index to `command` parameters for query string calls of this function.","content":{"application/json":{"schema":{"maxItems":"3","items":{"oneOf":[{"type":"string"},{"additionalProperties":"true","type":"object"}]},"minItems":"2","type":"array"},"examples":{"multiple":{"summary":"Call multiple UAPI functions.","value":["command=[\"PasswdStrength\",\"get_required_strength\",{\"app\":\"webdisk\"}]","command=[\"SSH\",\"get_port\"]"]},"multiple_indexed":{"summary":"Call multiple UAPI functions using indexed parameters.","value":["command-0=[\"PasswdStrength\",\"get_required_strength\",{\"app\":\"webdisk\"}]","command-1=[\"SSH\",\"get_port\"]"]}}}},"name":"command","in":"query","required":"true"}],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"strict","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"Batch","type":"string"},"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API."},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"data":{"type":"array","example":[{"warnings":null,"messages":null,"metadata":{},"status":"1","errors":null,"data":{"strength":"65"}},{"warnings":null,"messages":null,"status":"1","errors":null,"data":{"port":"22"},"metadata":{}}],"items":{"type":"object","properties":{"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","example":null},"data":{"additionalProperties":"true","type":"object","description":"The data returned by an individual UAPI call invoked through this `Batch::strict` call."},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}}}},"description":"An array of objects that contain function output. Each object contains the output data and metadata from one of the `command` parameter's functions.\n\nFor more information about UAPI return data and metadata, read our [UAPI - Return Data](https://go.cpanel.net/UAPIReturnData) documentation."},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}},"type":"object"}}}}},"tags":["Batch"],"x-codeSamples":[{"source":"uapi --output=jsonpretty --user=username Batch strict command-0='[ \"PasswdStrength\", \"get_required_strength\", { \"app\": \"webdisk\"} ]' command-1='[\"SSH\",\"get_port\"]'","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Batch/strict?command-0=%5b%20%22PasswdStrength%22%2c%20%22get_required_strength%22%2c%20%7b%20%22app%22%3a%20%22webdisk%22%7d%20%5d&command-1=%5B%22SSH%22%2C%22get_port%22%5D"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Batch_strict.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Batch_strict.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/Batch/,\n    q/strict/,\n    {\n        'command-0' => '[ \"PasswdStrength\", \"get_required_strength\", { \"app\": \"webdisk\"} ]',\n        'command-1' => '[\"SSH\",\"get_port\"]',\n    }\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Batch_strict.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Batch_strict.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    'Batch',\n    'strict',\n    array (\n        'command-0' => '[ \"PasswdStrength\", \"get_required_strength\", { \"app\": \"webdisk\"} ]',\n        'command-1' => '[\"SSH\",\"get_port\"]',\n    )\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","summary":"Run multiple UAPI functions in order"}}},"x-tagGroups":[{"name":"API Development Tools","tags":["Batch"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Batch","description":"The Batch module for UAPI."}]}},"WordPressBackup":{"is_running":{"tags":[{"name":"WordPressBackup","description":"The WordPressBackup module for UAPI."},{"name":"WordPress Manager Backups","description":"Optional Applications / WordPress Manager Backups"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Backups"]}],"paths":{"/WordPressBackup/is_running":{"get":{"x-cpanel-available-version":"WordPress Manager 3.0","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"WordPressBackup"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"action_id":{"type":"string","nullable":"true","example":"example.com__2018-10-10T10:53:31-0500","description":"The unique ID of the backup process."},"is_running":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether a backup is active.\n* `1` - Backup in progress.\n* `0` - No backup in progress."}}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"func":{"type":"string","example":"is_running","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"is_running","description":"This function checks for an active WordPress® site backup.\n\n**Note:**\n\nYou **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","parameters":[{"description":"The WordPress site's URL **without** `http://`.","schema":{"type":"string","example":"example.com\n\nexample.com/wordpress"},"in":"query","name":"site","required":"true"}],"x-cpanel-api-version":"UAPI","summary":"Return WordPress site backup status","tags":["WordPressBackup","WordPress Manager Backups"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressBackup \\\n  is_running \\\n  site='example.com\n\nexample.com/wordpress'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressBackup/is_running?site=example.com%0a%0aexample.com%2fwordpress"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressBackup_is_running.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressBackup_is_running.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/WordPressBackup/,\n    q/is_running/,\n    {\n        'site' => 'example.com\n\nexample.com/wordpress',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressBackup_is_running.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressBackup_is_running.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    'WordPressBackup',\n    'is_running',\n    array (\n        'site' => 'example.com\n\nexample.com/wordpress',\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}"}]}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"get_available_backups":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"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/","version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Backups"]}],"paths":{"/WordPressBackup/get_available_backups":{"get":{"operationId":"get_available_backups","description":"This function retrieves a list of available WordPress® site backups of a single site.\n\n**Note:**\n\nYou **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","parameters":[{"in":"query","name":"site","required":"true","description":"The WordPress site's URL **without** the protocol prefix.","schema":{"type":"string","example":"example.com/wordpress"}}],"x-cpanel-available-version":"WordPress Manager 3.0","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"properties":{"available":{"items":{"type":"object","properties":{"file":{"type":"string","example":"example.com__2018-10-10T10:53:31-0500.tar.gz","description":"The backup's file name with the `tar.zip` extension."},"path":{"description":"The absolute path to the backup file.","example":"/home/example/wordpress-backups/example.com__2018-10-10T10:53:31-0500.tar.gz","type":"string"},"site":{"example":"example.com","description":"The site's URL **without** the protocol prefix.","type":"string"},"date":{"type":"integer","example":"1539267197000","description":"The date and time the system created the backup.","format":"unix_timestamp"}}},"description":"An array of objects containing a list of the WordPress site's backups.","nullable":"true","type":"array"},"dir":{"example":"/home/example/wordpress-backups","description":"The absolute path to the backup directory.","type":"string"}},"type":"object"},"metadata":{"properties":{}}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"example":"WordPressBackup","description":"The name of the module called.","type":"string"},"func":{"example":"get_available_backups","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressBackup \\\n  get_available_backups \\\n  site='example.com/wordpress'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressBackup/get_available_backups?site=example.com%2fwordpress","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressBackup_get_available_backups.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressBackup_get_available_backups.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/WordPressBackup/,\n    q/get_available_backups/,\n    {\n        'site' => 'example.com/wordpress',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressBackup_get_available_backups.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressBackup_get_available_backups.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    'WordPressBackup',\n    'get_available_backups',\n    array (\n        'site' => 'example.com/wordpress',\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}"}],"tags":["WordPressBackup","WordPress Manager Backups"],"summary":"Return WordPress site backups","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The WordPressBackup module for UAPI.","name":"WordPressBackup"},{"description":"Optional Applications / WordPress Manager Backups","name":"WordPress Manager Backups"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"any_running":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"tags":[{"description":"The WordPressBackup module for UAPI.","name":"WordPressBackup"},{"name":"WordPress Manager Backups","description":"Optional Applications / WordPress Manager Backups"}],"servers":[{"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."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["WordPress Manager Backups"],"name":"Optional Applications"}],"paths":{"/WordPressBackup/any_running":{"get":{"summary":"Return all WordPress sites' backup status","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressBackup \\\n  any_running\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressBackup/any_running"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressBackup_any_running.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressBackup_any_running.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/WordPressBackup/,\n    q/any_running/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressBackup_any_running.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressBackup_any_running.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    'WordPressBackup',\n    'any_running'\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}"}],"tags":["WordPressBackup","WordPress Manager Backups"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"any_running","description":"The name of the method called.","type":"string"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"* 1 - Success.\n* 0 - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"data":{"properties":{"sse_url":{"description":"The SSE service URL that the system uses to monitor the backup progress. The SSE service URL does not contain a protocol, hostname, or port.","example":"/sse/WordPressBackup","type":"string"},"sites":{"type":"array","description":"An array that contains each site with a backup in progress. The function only populates this array if it is actively processing a backup.","items":{"properties":{"type":{"type":"string","description":"The type of process that is active.\n\n**Note:**\n\n`backup` is the only possible value.","example":"backup"},"id":{"nullable":"true","description":"The WordPress site's unique ID.\n\n**Note:**\n\n`null` is the only possible value. We have not implemented this return.","example":"null","type":"string"},"site":{"type":"string","example":"example.com","description":"The WordPress site's URL. The URL does not contain a protocol prefix."}},"type":"object"}},"any_running":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether any backups are in progess.\n* `1` - Backups are in progress.\n* `0` - No backups are in progress."}},"type":"object"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"WordPressBackup","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"WordPress Manager 3.0","parameters":[],"description":"This function checks for any active WordPress® site backups on the cPanel account.\n\n**Note:**\n\nYou **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"any_running"}}}},"cancel":{"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"WordPressBackup","description":"The WordPressBackup module for UAPI."},{"name":"WordPress Manager Backups","description":"Optional Applications / WordPress Manager Backups"}],"paths":{"/WordPressBackup/cancel":{"get":{"parameters":[{"required":"true","in":"query","name":"site","schema":{"anyOf":[{"format":"domain","example":"example.com"},{"format":"url-path","example":"example.com/wordpress"}],"type":"string"},"example":"example.com","description":"The WordPress site's URL without the protocol prefix."}],"description":"This function cancels a WordPress® site backup.\n\n**Note:**\n\n  You **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"cancel","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"cancel","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{}},"data":{"properties":{"ok":{"enum":["0","1"],"example":"0","description":"Whether the system cancelled an active backup.\n* `1` — Backup cancelled.\n* `0` — Could not cancel the backup or no active backup in progress.","type":"integer"},"site":{"type":"string","oneOf":[{"example":"example.com","format":"domain"},{"example":"example.com/wordpress","format":"url-path"}],"description":"The site's URL without the protocol prefix."}},"type":"object"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}},"type":"object"},"module":{"description":"The name of the module called.","example":"WordPressBackup","type":"string"}}}}}}},"x-cpanel-available-version":"WordPress Manager 3.0","tags":["WordPressBackup","WordPress Manager Backups"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressBackup \\\n  cancel \\\n  site='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressBackup/cancel?site=example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressBackup_cancel.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressBackup_cancel.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/WordPressBackup/,\n    q/cancel/,\n    {\n        'site' => '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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressBackup_cancel.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressBackup_cancel.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    'WordPressBackup',\n    'cancel',\n    array (\n        'site' => '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}"}],"x-cpanel-api-version":"UAPI","summary":"Stop WordPress site backup"}}},"x-tagGroups":[{"tags":["WordPress Manager Backups"],"name":"Optional Applications"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"start":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"name":"WordPressBackup","description":"The WordPressBackup module for UAPI."},{"description":"Optional Applications / WordPress Manager Backups","name":"WordPress Manager Backups"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["WordPress Manager Backups"],"name":"Optional Applications"}],"paths":{"/WordPressBackup/start":{"get":{"description":"This function starts a single WordPress® site backup.\n\n**Note:**\n\nYou **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"start","parameters":[{"description":"The WordPress site's URL without the protocol prefix.","example":"example.com","schema":{"type":"string","anyOf":[{"format":"url-path","example":"example.com/wordpress"},{"format":"domain","example":"example.com"}]},"in":"query","name":"site","required":"true"}],"x-cpanel-available-version":"WordPress Manager 3.0","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"WordPressBackup","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"properties":{"site":{"description":"The WordPress site's URL without the protocol prefix.","type":"string","oneOf":[{"example":"example.com","format":"domain"},{"format":"url-path","example":"example.com/wordpress"}]},"backup_id":{"example":"example.com__2018-10-10T10:53:31-0500","description":"The unique ID of the backup process.","type":"string"},"sse_url":{"type":"string","description":"The SSE path **without** the protocol, hostname, or port that the system uses to monitor the backup progress.","format":"url-path","example":"/sse/WordPressBackup"}},"type":"object"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}}},"type":"object"},"func":{"type":"string","example":"start","description":"The name of the method called."}}}}}}},"tags":["WordPressBackup","WordPress Manager Backups"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressBackup \\\n  start \\\n  site='example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressBackup/start?site=example.com","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressBackup_start.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressBackup_start.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/WordPressBackup/,\n    q/start/,\n    {\n        'site' => '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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressBackup_start.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressBackup_start.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    'WordPressBackup',\n    'start',\n    array (\n        'site' => '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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Backup WordPress site"}}}},"cleanup":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"WordPressBackup","description":"The WordPressBackup module for UAPI."},{"description":"Optional Applications / WordPress Manager Backups","name":"WordPress Manager Backups"}],"paths":{"/WordPressBackup/cleanup":{"get":{"summary":"Delete WordPress backup temporary files","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  WordPressBackup \\\n  cleanup \\\n  site='example.com/wordpress'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/WordPressBackup/cleanup?site=example.com%2fwordpress"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file WordPressBackup_cleanup.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/WordPressBackup_cleanup.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/WordPressBackup/,\n    q/cleanup/,\n    {\n        'site' => 'example.com/wordpress',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file WordPressBackup_cleanup.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/WordPressBackup_cleanup.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    'WordPressBackup',\n    'cleanup',\n    array (\n        'site' => 'example.com/wordpress',\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}"}],"tags":["WordPressBackup","WordPress Manager Backups"],"x-cpanel-available-version":"WordPress Manager 3.0","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"cleanup","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"data":{"properties":{"ok":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the system released the system resources.\n* `1` - Resources released.\n* `0` - Backup in progress."},"site":{"type":"string","example":"example.com","description":"The site's URL **without** the protocol prefix."}},"type":"object","nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}}},"type":"object"},"module":{"type":"string","example":"WordPressBackup","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function releases any system resources from a previous WordPress® site backup.\n\n**Note:**\n\nYou **must** install the [WordPress Manager](https://go.cpanel.net/wordpressmanager) cPanel plugin to access this API function.","operationId":"cleanup","parameters":[{"name":"site","in":"query","required":"true","description":"The WordPress site's URL **without** the protocol prefix.","schema":{"example":"example.com/wordpress","type":"string"}}]}}},"x-tagGroups":[{"name":"Optional Applications","tags":["WordPress Manager Backups"]}]}},"UserData":{"set_scoped_userdata":{"paths":{"/UserData/set_scoped_userdata":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n--user=username \\\nUserData \\\nset_scoped_userdata \\\nscope=ui_prefs \\\nkey=theme \\\nvalue=dark\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserData/set_scoped_userdata?scope=ui_prefs&key=theme&value=dark\n","label":"URL","lang":"HTTP"},{"source":"use strict;\nuse Cpanel::LiveAPI ();\nmy $cpanel = Cpanel::LiveAPI->new();\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\nmy $response = $cpanel->uapi(\n    q/UserData/,\n    q/set_scoped_userdata/,\n    q/scope=ui_prefs/,\n    q/key=theme/,\n    q/value=dark/,\n);\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$cpanel->end();\nsub to_json { require JSON; JSON->new->pretty->encode($_[0]) }\n","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\nheader('Content-Type: text/plain');\n$cpanel = new CPANEL();\n$response = $cpanel->uapi('UserData', 'set_scoped_userdata', array('scope' => 'ui_prefs', 'key' => 'theme', 'value' => 'dark'));\nif ($response['cpanelresult']['result']['status']) {\n    $data = $response['cpanelresult']['result']['data'];\n    print json_encode($data, JSON_PRETTY_PRINT);\n} else {\n    print json_encode($response['cpanelresult']['result']['errors'], JSON_PRETTY_PRINT);\n}\n$cpanel->end();"}],"tags":["UserData"],"summary":"Set scoped userdata key/value","x-cpanel-api-version":"UAPI","parameters":[{"description":"The scope name to modify.","schema":{"example":"example_scope","type":"string"},"in":"query","name":"scope","required":"true"},{"description":"The userdata key to set.\n\n**Note:** The \"json\" argument cannot be used with the \"key\" or \"value\" arguments.","schema":{"example":"theme","type":"string"},"name":"key","in":"query","required":"false"},{"in":"query","name":"value","required":"false","description":"The value to assign to the key.\n\n**Note:** The \"json\" argument cannot be used with the \"key\" or \"value\" arguments.","schema":{"example":"dark","type":"string"}},{"description":"A json string to save to the specified scope.\n\n**Note:** The \"json\" argument cannot be used with the \"key\" or \"value\" arguments.","schema":{"example":"{\"theme\":\"dark\"}","type":"string"},"in":"query","name":"json","required":"false"}],"operationId":"set_scoped_userdata","description":"This function sets (creates or updates) a userdata key/value pair within a specified scope and returns the full updated mapping for that scope.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"data":{"example":{"items_per_page":"50","theme":"dark","show_help_tour":"0"},"description":"The updated scoped userdata mapping after the key/value was set.","type":"object","additionalProperties":{"description":"A stored value associated with a key in the scope.","type":"string"}},"metadata":{"properties":{}},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"module":{"type":"string","description":"The name of the module called.","example":"UserData"},"func":{"example":"set_scoped_userdata","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"11.32"}}},"x-tagGroups":[{"tags":["UserData"],"name":"UserData"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The UserData module for cPanel UAPI.","name":"UserData"}],"info":{"description":"Set (create or update) a scoped userdata key/value pair and return the updated mapping.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.97.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"get_scoped_userdata":{"tags":[{"description":"The UserData module for cPanel UAPI.","name":"UserData"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel.","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["UserData"],"name":"UserData"}],"paths":{"/UserData/get_scoped_userdata":{"get":{"x-cpanel-available-version":"11.32","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"get_scoped_userdata","description":"The name of the method called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"type":"object","additionalProperties":{"description":"A stored value associated with a key in the scope.","type":"string"},"example":{"items_per_page":"50","show_help_tour":"0","theme":"dark"},"description":"The requested scoped userdata mapping."},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","nullable":"true","type":"array"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"UserData","description":"The name of the module called.","type":"string"}}}}}}},"description":"This function returns all userdata key/value pairs for a given scope.","operationId":"get_scoped_userdata","parameters":[{"in":"query","name":"scope","required":"true","description":"The scope name whose userdata you wish to retrieve.","schema":{"type":"string","example":"example_scope"}}],"x-cpanel-api-version":"UAPI","summary":"Return scoped userdata mapping","tags":["UserData"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n--user=username \\\nUserData \\\nget_scoped_userdata \\\nscope=ui_prefs\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/UserData/get_scoped_userdata?scope=ui_prefs\n","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"use strict;\nuse Cpanel::LiveAPI ();\nmy $cpanel = Cpanel::LiveAPI->new();\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\nmy $response = $cpanel->uapi(\n    q/UserData/,\n    q/get_scoped_userdata/,\n    q/scope=ui_prefs/,\n);\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$cpanel->end();\nsub to_json { require JSON; JSON->new->pretty->encode($_[0]) }\n"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\nheader('Content-Type: text/plain');\n$cpanel = new CPANEL();\n$response = $cpanel->uapi('UserData', 'get_scoped_userdata', array('scope' => 'ui_prefs'));\nif ($response['cpanelresult']['result']['status']) {\n    $data = $response['cpanelresult']['result']['data'];\n    print json_encode($data, JSON_PRETTY_PRINT);\n} else {\n    print json_encode($response['cpanelresult']['result']['errors'], JSON_PRETTY_PRINT);\n}\n$cpanel->end();"}]}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"Return scoped userdata key/value pairs.","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.97.0.9999"}}},"Locale":{"list_locales":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"tags":["Language"],"name":"cPanel Theme Management"}],"paths":{"/Locale/list_locales":{"get":{"summary":"Return available locales","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Locale \\\n  list_locales\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Locale/list_locales"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Locale_list_locales.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Locale_list_locales.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/Locale/,\n    q/list_locales/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Locale_list_locales.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Locale_list_locales.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    'Locale',\n    'list_locales'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Locale","Language"],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"Locale","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"data":{"type":"array","items":{"properties":{"name":{"type":"string","example":"German","description":"The locale's full name."},"direction":{"description":"The locale's text direction.\n* `ltr` - Left to right.\n* `rtl` - Right to left.","enum":["ltr","rtl"],"example":"ltr","type":"string"},"local_name":{"type":"string","description":"The locale's full name, in the locale's language.","example":"Deutsch"},"locale":{"format":"ISO-3166-1 (alpha-2)","description":"The locale's two-letter [ISO-3166 code](http://www.iso.org/iso/country_codes.htm).","example":"de","type":"string"}},"type":"object"}},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"}}},"func":{"example":"list_locales","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"operationId":"list_locales","description":"This function lists an account's available interface languages.","parameters":[]}}},"tags":[{"name":"Locale","description":"The Locale module for UAPI."},{"name":"Language","description":"cPanel Theme Management / Language"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}]},"get_attributes":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The Locale module for UAPI.","name":"Locale"},{"name":"Language","description":"cPanel Theme Management / Language"}],"paths":{"/Locale/get_attributes":{"get":{"summary":"Return current locale settings","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Locale \\\n  get_attributes\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Locale/get_attributes"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Locale_get_attributes.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Locale_get_attributes.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/Locale/,\n    q/get_attributes/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Locale_get_attributes.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Locale_get_attributes.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    'Locale',\n    'get_attributes'\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}"}],"tags":["Locale","Language"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_attributes","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"Locale"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"metadata":{"properties":{}},"data":{"type":"object","properties":{"encoding":{"description":"The user's character set.","example":"utf-8","type":"string"},"locale":{"type":"string","example":"en","description":"The locale's two-letter ISO-3166 code.","format":"ISO-3166-1 (alpha-2)"},"direction":{"type":"string","description":"The locale's text direction.\n* `ltr` - left to right.\n* `rtl` - right to left.","enum":["ltr","rtl"],"example":"ltr"},"name":{"type":"string","example":"English","description":"The locale's full name."}}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[],"operationId":"get_attributes","description":"This function retrieves information about the user's current locale setting."}}},"x-tagGroups":[{"tags":["Language"],"name":"cPanel Theme Management"}],"openapi":"3.0.2","info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"set_locale":{"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The Locale module for UAPI.","name":"Locale"},{"description":"cPanel Theme Management / Language","name":"Language"}],"paths":{"/Locale/set_locale":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update cPanel account locale","tags":["Locale","Language"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Locale \\\n  set_locale \\\n  locale='en'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Locale/set_locale?locale=en","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Locale_set_locale.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Locale_set_locale.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/Locale/,\n    q/set_locale/,\n    {\n        'locale' => 'en',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Locale_set_locale.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Locale_set_locale.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    'Locale',\n    'set_locale',\n    array (\n        'locale' => 'en',\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}"}],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"set_locale","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"Locale","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}}}}}},"description":"HTTP Request was successful."}},"description":"This function sets the account's locale.","operationId":"set_locale","parameters":[{"description":"The locale's abbreviated name according to UAPI's `Locale::list_locales` function.","schema":{"example":"en","type":"string"},"name":"locale","in":"query","required":"true"}]}}},"x-tagGroups":[{"tags":["Language"],"name":"cPanel Theme Management"}]}},"Integration":{"fetch_url":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"name":"Integration","description":"The Integration module for UAPI."},{"name":"URL Parsing","description":"API Development Tools / URL Parsing"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["URL Parsing"],"name":"API Development Tools"}],"paths":{"/Integration/fetch_url":{"get":{"summary":"Return integrated application URL","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Integration \\\n  fetch_url \\\n  app='applicationname'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Integration/fetch_url?app=applicationname","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Integration_fetch_url.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Integration_fetch_url.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/Integration/,\n    q/fetch_url/,\n    {\n        'app' => 'applicationname',\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Integration_fetch_url.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Integration_fetch_url.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    'Integration',\n    'fetch_url',\n    array (\n        'app' => 'applicationname',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Integration","URL Parsing"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"type":"object","properties":{"url":{"description":"The publicly-available URL to which the application redirects visitors if the `redirect_url` location is unavailable.","format":"url","example":"http://application.example.com/","type":"string"},"redirect_url":{"type":"string","format":"url","description":"The publicly-available URL to which the application will redirect visitors.","example":"http://application.example.com/application"}}},"metadata":{"properties":{}},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"module":{"description":"The name of the module called.","example":"Integration","type":"string"},"func":{"description":"The name of the method called.","example":"fetch_url","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 54","parameters":[{"in":"query","name":"app","required":"true","description":"The application's name.","schema":{"example":"applicationname","type":"string"}}],"operationId":"fetch_url","description":"This function returns the URL for an integrated application."}}}}},"Restore":{"directory_listing":{"tags":[{"name":"File Restoration","description":"cPanel Account Backups / File Restoration"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"cPanel Account Backups","tags":["File Restoration"]}],"paths":{"/Restore/directory_listing":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Restore \\\n  directory_listing \\\n  path='/public_html/'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Restore/directory_listing?path=%2fpublic_html%2f","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Restore_directory_listing.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Restore_directory_listing.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/Restore/,\n    q/directory_listing/,\n    {\n        'path' => '/public_html/',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Restore_directory_listing.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Restore_directory_listing.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    'Restore',\n    'directory_listing',\n    array (\n        'path' => '/public_html/',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["File Restoration"],"summary":"Return backups in home directory","x-cpanel-api-version":"UAPI","parameters":[{"name":"path","in":"query","required":"true","description":"A path to a subdirectory within the user's home directory, or any level below it.\n\n**Note:**\n\nThe value of this parameter **must** begin and end with a forward slash (`/`) for security purposes.","schema":{"example":"/public_html/","type":"string"}}],"description":"This function lists all of the backup files and directories in the user's home directory.\n\n**Important:**\n\nWhen you disable the [File Storage role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"directory_listing","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"properties":{"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"description":"An object that contains information about a specific item stored in the backup.","items":{"properties":{"exists":{"description":"Whether the file exists in the user's directory or **only** in the backup.\n* `1` - File exists in the user's directory.\n* `0` - File exists **only** in the backup.","example":"1","enum":["0","1"],"type":"integer"},"conflict":{"example":"0","enum":["0","1"],"description":"Whether a difference exists between the `type` and `onDiskType` returns.\n* `1` - Conflict exists.\n* `0` - **No** conflict exists.","type":"integer"},"type":{"type":"string","description":"The item type stored in the backup.\n* `dir` - A directory.\n* `file` - A file.\n* `symlink` - A symlink.\n* `unknown` - An unknown file type.","enum":["dir","file","symlink","unknown"],"example":"file"},"onDiskType":{"type":"string","description":"The item type stored on the disk.\n* `dir` - A directory.\n* `file` - A file.\n* `symlink` - A symlink.\n* `unknown` - An unknown file type.","example":"file","enum":["dir","file","symlink","unknown"]},"name":{"example":"public_html","description":"The name of the file or directory.","type":"string"}},"type":"object"},"type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"Restore","description":"The name of the module called."},"func":{"description":"The name of the method called.","example":"directory_listing","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 68"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"restore_file":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["File Restoration"],"name":"cPanel Account Backups"}],"paths":{"/Restore/restore_file":{"get":{"x-cpanel-api-version":"UAPI","summary":"Restore file or directory","tags":["File Restoration"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Restore \\\n  restore_file \\\n  backupID='weekly/2017-07-03' \\\n  path='/public_html/index.php' \\\n  overwrite='1'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Restore/restore_file?backupID=weekly%2f2017-07-03&path=%2fpublic_html%2findex.php&overwrite=1","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Restore_restore_file.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Restore_restore_file.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/Restore/,\n    q/restore_file/,\n    {\n        'backupID' => 'weekly/2017-07-03',\n        'path' => '/public_html/index.php',\n        'overwrite' => '1',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Restore_restore_file.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Restore_restore_file.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    'Restore',\n    'restore_file',\n    array (\n        'backupID' => 'weekly/2017-07-03',\n        'path' => '/public_html/index.php',\n        'overwrite' => '1',\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}"}],"x-cpanel-available-version":"cPanel 68","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"restore_file","description":"The name of the method called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"type":"object","properties":{"success":{"type":"integer","enum":["1","0"],"example":"1","description":"Whether the `overwrite` parameter succeeded.\n\n* `1` — Success.\n* `0` — Failure."}},"description":"An object containing the status of the operation."},"metadata":{"properties":{}}},"type":"object"},"module":{"example":"Restore","description":"The name of the module called.","type":"string"}},"type":"object"}}}}},"operationId":"restore_file","description":"This function restores a file or directory from a backup to the file or directory's original location.\n\n**Important:**\n\nWhen you disable the [File Storage role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","parameters":[{"in":"query","name":"backupID","required":"true","description":"The backup's identification.\n\n* `YYYY-MM-DD` — Restore a daily backup from the specified backup date.\n* `incremental` — Restore a daily incremental backup.\n* `weekly/YYYY-MM-DD` — Restore a weekly backup from the specified backup date.\n* `monthly/YYYY-MM-DD` — Restore a monthly backup from the specified backup date.\n* `weekly/incremental` — Restore a weekly incremental backup.\n* `monthly/incremental` — Restore a monthly incremental backup.","schema":{"example":"weekly/2017-07-03","anyOf":[{"format":"ISO-8601 Date","description":"A daily backup file from a specified backup date.","type":"string"},{"type":"string","enum":["incremental"],"description":"An incremental daily backup."},{"description":"A weekly or monthly incremental backup.","enum":["weekly/incremental","monthly/incremental"],"type":"string"},{"description":"A weekly or monthly backup from a specified backup date.","type":"string"}]}},{"description":"The absolute file or directory's path, within a backup, that you wish to restore.\n\n**Important:**\n\n* The value of this parameter **must** begin with a forward slash (/).\n* You **must** parse filenames properly to prevent a cross-site scripting (XSS) attack.","schema":{"type":"string","example":"/public_html/index.php","format":"path"},"in":"query","name":"path","required":"true"},{"schema":{"example":"1","enum":["1","0"],"type":"integer"},"description":"Whether to overwrite the file or directory on the disc with its backup replacement.\n\n* `1` — Overwrite the file or directory.\n* `0` — Do **not** overwrite the file or directory.","required":"true","name":"overwrite","in":"query"}]}}},"tags":[{"description":"cPanel Account Backups / File Restoration","name":"File Restoration"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}]},"get_users":{"x-tagGroups":[{"name":"cPanel Account Backups","tags":["File Restoration"]}],"paths":{"/Restore/get_users":{"get":{"x-cpanel-available-version":"cPanel 72","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Restore","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"data":{"type":"array","description":"An array of reseller account names.","items":{"type":"string","format":"username","example":"username"}}}},"func":{"type":"string","description":"The name of the method called.","example":"get_users"}}}}}}},"description":"This function lists a reseller's users that have existing backup metadata.\n\n**Note:**\n\nWhen you disable the [File Storage role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"get_users","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return cPanel accounts with backup metadata","tags":["File Restoration"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Restore \\\n  get_users\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Restore/get_users"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Restore_get_users.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Restore_get_users.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/Restore/,\n    q/get_users/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Restore_get_users.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Restore_get_users.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    'Restore',\n    'get_users'\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}"}]}}},"tags":[{"name":"File Restoration","description":"cPanel Account Backups / File Restoration"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"openapi":"3.0.2"},"query_file_info":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"tags":[{"description":"cPanel Account Backups / File Restoration","name":"File Restoration"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"name":"cPanel Account Backups","tags":["File Restoration"]}],"paths":{"/Restore/query_file_info":{"get":{"parameters":[{"description":"A file, directory, or symlink in the user's directory tree.\n\n**Note:**\n\nThe value of this parameter **must** begin with a forward slash (`/`).","schema":{"format":"path","example":"/public_html/index.php","type":"string"},"in":"query","name":"path","required":"true"},{"schema":{"default":"0","example":"0","enum":["1","0"],"type":"integer"},"description":"Whether to show the `exist` return, which indicates whether the item exists in the\nlocal disk or only in the backup.\n\n* `1` — Show the `exist` return's value.\n* `0` — Do **not** show the `exists` return's value.","required":"false","name":"exists","in":"query"}],"description":"This function lists all of an item's backup locations. An item can be a file, a directory, or a symlink.\n\n**Important:**\n\nWhen you disable the [File Storage role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"query_file_info","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"data":{"items":{"type":"object","properties":{"fileSize":{"type":"integer","minimum":"0","description":"The size, in bytes, of the file in the backup.\n\n**Note:**\n\nThe function returns this value **only** if the item is a file.","example":"199"},"backupDate":{"example":"2020-07-01","format":"ISO-8601 Date","description":"The date when the system created the backup.","type":"string"},"path":{"type":"string","example":"/public_html/index.php","description":"The identical file path value that the system passed in the function.","format":"path"},"backupType":{"type":"string","example":"compressed","enum":["compressed","incremental","uncompressed"],"description":"The backup type.\n\n* `compressed` —  A compressed tar file.\n* `incremental` — A full tree of files and directories.\n* `uncompressed` — An uncompressed tar file."},"exists":{"type":"integer","description":"Whether the item (a file, a directory, or a symlink) exists in the local disk or only in the backup.\n\n* `1` — The item exists in the local disk.\n* `0` — The item exists only in the backup.\n\n**Note:**\n\nThis return appears **only** if you set the `exists` parameter to `1`.","enum":["1","0"],"example":"1"},"mtime":{"example":"1520043240","description":"The file's last modification time.","format":"unix_timestamp","type":"integer"},"type":{"type":"string","description":"The item type stored in the backup.\n\n* `dir` — A directory.\n* `file` — A file.\n* `symlink` — A symlink.\n* `unknown` — An unknown file type.","enum":["dir","file","symlink","unknown"],"example":"file"},"backupID":{"example":"weekly/2017-07-01","description":"The backup's identification.\n\n* A date, in `YYYY-MM-DD` format.\n* `incremental` — An incremental daily backup.\n* The backup frequency (`weekly` or `monthly`) , a slash character (`/`), and the value `incremental`.\n* The backup frequency (`weekly` or `monthly`), a slash character (`/`), and the backup date, in `YYYY-MM-DD` format.","anyOf":[{"format":"ISO-8601 Date","description":"A daily backup file from a specified backup date.","type":"string"},{"description":"An incremental daily backup.","enum":["incremental"],"type":"string"},{"description":"A weekly or monthly incremental backup.","enum":["weekly/incremental","monthly/incremental"],"type":"string"},{"type":"string","description":"A weekly or monthly backup from a specified backup date."}],"type":"string"}}},"description":"An array of objects containing the item's details.","type":"array"},"status":{"enum":["1","0"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"Restore","description":"The name of the module called.","type":"string"},"func":{"example":"query_file_info","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 68","tags":["File Restoration"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Restore \\\n  query_file_info \\\n  path='/public_html/index.php'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Restore/query_file_info?path=%2fpublic_html%2findex.php"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Restore_query_file_info.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/<theme_name>/\n#    to .../frontend/<theme_name>/api_examples/Restore_query_file_info.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/Restore/,\n    q/query_file_info/,\n    {\n        'path' => '/public_html/index.php',\n    }\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme_name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Restore_query_file_info.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/<theme_name>/\n//    to .../frontend/<theme_name>/api_examples/Restore_query_file_info.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    'Restore',\n    'query_file_info',\n    array (\n        'path' => '/public_html/index.php',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return backup storage locations"}}}}},"Parser":{"firstfile_relative_uri":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"tags":["URL Parsing"],"name":"API Development Tools"}],"paths":{"/Parser/firstfile_relative_uri":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"metadata":{"properties":{}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"data":{"type":"object","properties":{"uri":{"description":"The file's absolute file path.","example":"/usr/local/cpanel/base/favicon.ico","type":"string"}}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"Parser","type":"string"},"func":{"type":"string","example":"firstfile_relative_uri","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"firstfile_relative_uri","description":"This function reports the first file's URI, relative to the cPanel base directory.","parameters":[],"summary":"Return session relative URI","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Parser \\\n  firstfile_relative_uri\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Parser/firstfile_relative_uri","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\t  \n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Parser_firstfile_relative_uri.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Parser_firstfile_relative_uri.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/Parser/,\n    q/firstfile_relative_uri/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\t  \n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Parser_firstfile_relative_uri.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Parser_firstfile_relative_uri.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    'Parser',\n    'firstfile_relative_uri'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Parser","URL Parsing"]}}},"tags":[{"name":"Parser","description":"The Parser module for UAPI."},{"name":"URL Parsing","description":"API Development Tools / URL Parsing"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}]}},"Features":{"list_features":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The Features module for UAPI.","name":"Features"},{"name":"cPanel Features","description":"cPanel Account / cPanel Features"}],"paths":{"/Features/list_features":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return cPanel account's features","tags":["Features","cPanel Features"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Features \\\n  list_features\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Features/list_features","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Features_list_features.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Features_list_features.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/Features/,\n    q/list_features/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Features_list_features.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Features_list_features.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    'Features',\n    'list_features'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"list_features"},"module":{"description":"The name of the module called.","example":"Features","type":"string"},"result":{"properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"data":{"description":"Features available to the account. The key is a feature name and the value\nis whether the feature is installed.\n\n**Note:**\n\nThis function returns features that third-party software or plugins provide.","example":{"emailtrace":"1","spambox":"1","email_disk_usage":"1","emailarchive":"1","spamassassin":"1","emaildomainfwd":"1","popaccts":"1","traceaddy":"1","chat":"0","blockers":"1","webmail":"1","changemx":"1","boxtrapper":"1","updatecontact":"1","emailauth":"1","bbs":"0","defaultaddress":"1"},"additionalProperties":{"type":"integer","description":"Whether the feature is installed.\n* `1` - Installed.\n* `0` - **Not** installed.","example":"0","enum":["0","1"]},"type":"object"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[],"description":"This function lists a cPanel account's features.","operationId":"list_features"}}},"x-tagGroups":[{"name":"cPanel Account","tags":["cPanel Features"]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"get_feature_metadata":{"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"tags":[{"description":"The Features module for UAPI.","name":"Features"},{"description":"cPanel Account / cPanel Features","name":"cPanel Features"}],"paths":{"/Features/get_feature_metadata":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return cPanel account's features' metadata","tags":["Features","cPanel Features"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Features \\\n  get_feature_metadata\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Features/get_feature_metadata"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Features_get_feature_metadata.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Features_get_feature_metadata.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/Features/,\n    q/get_feature_metadata/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Features_get_feature_metadata.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Features_get_feature_metadata.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    'Features',\n    'get_feature_metadata'\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}"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"get_feature_metadata","description":"The name of the method called."},"module":{"example":"Features","description":"The name of the module called.","type":"string"},"result":{"properties":{"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"description":"An array of objects containing feature information.","items":{"type":"object","properties":{"is_plugin":{"description":"Whether the feature is a [plugin](https://go.cpanel.net/cpanelplugin).\n\n* `1` — Plugin.\n* `0` — **Not** a plugin.","enum":["1","0"],"example":"1","type":"integer"},"is_cpaddon":{"description":"Whether the feature is a [cPAddon](https://go.cpanel.net/cPanelGlossary#addons-cpaddons).\n\n* `1` — cPAddon.\n* `0` — **Not** a cPAddon.","example":"0","enum":["1","0"],"type":"integer"},"name":{"type":"string","description":"The feature's name.","example":"Wordpress Manager"},"id":{"example":"wordpress_manager","description":"The feature's system ID.","type":"string"}}},"type":"array"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}}}},"x-cpanel-available-version":"cPanel 80","parameters":[],"description":"This function lists the details of a cPanel account's available feature lists.","operationId":"get_feature_metadata"}}},"x-tagGroups":[{"name":"cPanel Account","tags":["cPanel Features"]}]},"has_features_like":{"info":{"version":"11.130.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/Features/has_features_like":{"get":{"tags":["Features","cPanel Features"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Features \\\n  has_features_like \\\n  pattern='mail'\n"},{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Features \\\n  has_features_like \\\n  pattern='^ssl.*' \\\n  is_regex=1\n","lang":"Shell","label":"CLI (Regex)"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Features/has_features_like?pattern=mail","lang":"HTTP","label":"URL"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Features/has_features_like?pattern=%5Essl.*&is_regex=1","label":"URL (Regex)","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Features_has_features_like.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Features_has_features_like.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/Features/,\n    q/has_features_like/,\n    {\n        'pattern' => 'mail',\n        'is_regex' => 0,\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Features_has_features_like.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Features_has_features_like.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    'Features',\n    'has_features_like',\n    array (\n        'pattern' => 'mail',\n        'is_regex' => 0,\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}"}],"x-cpanel-api-version":"UAPI","summary":"Return whether queried features are enabled","description":"This function allows you to search for cPanel account features and determine whether those features\nare enabled.","operationId":"has_features_like","parameters":[{"required":"true","in":"query","name":"pattern","schema":{"example":"mail","type":"string"},"description":"The feature's name that you wish to search.\n\n**Note:**\n\nTo use a regular expression, you must set the `is_regex` parameter's value to `true`."},{"schema":{"type":"integer","default":"0","example":"0","enum":["0","1"]},"description":"Whether the `pattern` parameter's value is a regular expression.\n*  `1` - The `pattern` parameter's value is a regular expression.\n*  `0` - The `pattern` parameter's value is **not** a regular expression","required":"false","in":"query","name":"is_regex"}],"x-cpanel-available-version":"cPanel 11.130","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"has_features_like","description":"The name of the method called."},"module":{"example":"Features","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"description":"Whether the API call was successful.\n* `1` - Success. Features were searched and results returned.\n* `0` - Failed. Check the `errors` field for details (e.g., missing pattern).","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.\n\nCommon errors include missing pattern parameter or invalid regular expression syntax.","example":null},"data":{"nullable":"true","description":"Object containing the result of the feature search.","example":{"has_matching_features":"1"},"type":"object","properties":{"has_matching_features":{"description":"Whether any features match the search pattern and are enabled.\n* `1` - At least one matching feature is enabled.\n* `0` - No matching features are enabled (either no matches or all matches are disabled).","example":"1","enum":["0","1"],"type":"integer"}}},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"}}},"examples":{"has-enabled-features":{"value":{"result":{"warnings":null,"messages":null,"metadata":{},"status":"1","errors":null,"data":{"has_matching_features":"1"}}},"summary":"Pattern matches enabled features"},"missing-pattern":{"value":{"result":{"errors":["\"pattern\" is required"],"status":"0","data":null,"metadata":{},"warnings":null,"messages":null}},"summary":"Pattern parameter is required"},"no-enabled-features":{"value":{"result":{"metadata":{},"data":{"has_matching_features":"0"},"errors":null,"status":"1","messages":null,"warnings":null}},"summary":"Pattern matches features but none are enabled"},"no-matches":{"summary":"No features match the pattern","value":{"result":{"messages":null,"warnings":null,"data":{"has_matching_features":"0"},"errors":null,"status":"1","metadata":{}}}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"name":"cPanel Account","tags":["cPanel Features"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Features","description":"The Features module for UAPI."},{"description":"cPanel Account / cPanel Features","name":"cPanel Features"}]},"list_features_like":{"x-tagGroups":[{"name":"cPanel Account","tags":["cPanel Features"]}],"paths":{"/Features/list_features_like":{"get":{"description":"This function allows you to search for enabled cPanel account features and lists those features\nin the returned payload.","operationId":"list_features_like","parameters":[{"schema":{"type":"string","example":"mail"},"description":"The feature's name that you wish to search.\n\n**Note:**\n\nTo use a regular expression, you must set the `is_regex` parameter's value to `true`.","required":"true","in":"query","name":"pattern"},{"required":"false","name":"is_regex","in":"query","schema":{"type":"integer","default":"0","enum":["0","1"],"example":"0"},"description":"Whether the `pattern` parameter's value is a regular expression.\n*  `1` - The `pattern` parameter's value is a regular expression.\n*  `0` - The `pattern` parameter's value is **not** a regular expression"}],"x-cpanel-available-version":"cPanel 11.130","responses":{"200":{"content":{"application/json":{"examples":{"missing-pattern":{"summary":"Pattern parameter is required","value":{"result":{"messages":null,"warnings":null,"data":null,"errors":["\"pattern\" is required"],"status":"0","metadata":{}}}},"regex-pattern-match":{"value":{"result":{"metadata":{},"data":["sslmanager"],"errors":null,"status":"1","messages":null,"warnings":null}},"summary":"Regular expression pattern matching with anchors"},"string-pattern-match":{"value":{"result":{"metadata":{},"data":["webmail","emailauth"],"errors":null,"status":"1","messages":null,"warnings":null}},"summary":"Partial string pattern matching multiple enabled features"},"no-matches":{"summary":"No enabled features match the pattern","value":{"result":{"warnings":null,"messages":null,"metadata":{},"errors":null,"status":"1","data":[]}}}},"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"list_features_like"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.\n\nCommon errors include missing pattern parameter or invalid regular expression syntax.","example":null},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the API call was successful.\n* `1` - Success. Features were searched and results returned.\n* `0` - Failed. Check the `errors` field for details (e.g., missing pattern)."},"data":{"type":"array","nullable":"true","example":["webmail","emailauth"],"description":"A list of enabled feature names that match the search pattern.\n\n**Note:**\n\nThe function only returns enabled features.","items":{"type":"string"}},"metadata":{"properties":{}}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Features"}}}}},"description":"HTTP Request was successful."}},"tags":["Features","cPanel Features"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Features \\\n  list_features_like \\\n  pattern='mail'\n"},{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Features \\\n  list_features_like \\\n  pattern='^ssl.*' \\\n  is_regex=1\n","label":"CLI (Regex)","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Features/list_features_like?pattern=mail"},{"lang":"HTTP","label":"URL (Regex)","source":"https://hostname.example.com:2083/cpsess##########/execute/Features/list_features_like?pattern=%5Essl.*&is_regex=1"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Features_list_features_like.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Features_list_features_like.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/Features/,\n    q/list_features_like/,\n    {\n        'pattern' => 'mail',\n        'is_regex' => 0,\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Features_list_features_like.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Features_list_features_like.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    'Features',\n    'list_features_like',\n    array (\n        'pattern' => 'mail',\n        'is_regex' => 0,\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}"}],"x-cpanel-api-version":"UAPI","summary":"Return queried cPanel account features"}}},"tags":[{"name":"Features","description":"The Features module for UAPI."},{"name":"cPanel Features","description":"cPanel Account / cPanel Features"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.130.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2"},"has_feature":{"paths":{"/Features/has_feature":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"examples":{"does-not-have-feature":{"value":{"result":{"metadata":{},"data":null,"errors":null,"status":"0","messages":null,"warnings":null}},"summary":"The account does not have a feature."},"has-feature":{"value":{"result":{"warnings":null,"messages":null,"status":"1","errors":null,"data":null,"metadata":{}}},"summary":"The account has a feature."},"exists-but-acct-does-not-have":{"value":{"result":{"messages":["The feature “autossl” exists but is not enabled."],"warnings":null,"data":null,"status":"0","errors":null,"metadata":{}}},"summary":"The feature exists but the account does not have it enabled."}},"schema":{"properties":{"module":{"description":"The name of the module called.","example":"Features","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"Whether the feature exists on the system.\n\n* `1` — The feature exists on the system and it is enabled.\n* `0` — The feature exists on the system, but the user does **not** have it.\n* `null` — The feature is **not** installed on the system.","example":"1","enum":["0","1"],"nullable":"true"},"messages":{"items":{"type":"string"},"description":"A message about the feature's status.\n\n**Note:**\n\nThe function only returns a message when the feature exists but\nit is **not** enabled.","example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."}}},"func":{"type":"string","example":"has_feature","description":"The name of the method called."}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"schema":{"type":"string","example":"autossl"},"description":"The feature's name.","required":"true","in":"query","name":"name"}],"description":"This function checks whether a cPanel account has access to\na [feature](https://go.cpanel.net/whmdocsFeatureManager#selectable-features).","operationId":"has_feature","summary":"Validate cPanel account's feature access","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Features \\\n  has_feature \\\n  name='autossl'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Features/has_feature?name=autossl"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Features_has_feature.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/<theme-name>\n#    to .../frontend/<theme-name>/api_examples/Features_has_feature.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/Features/,\n    q/has_feature/,\n    {\n        'name' => 'autossl',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Features_has_feature.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/<theme-name>\n//    to .../frontend/<theme-name>/api_examples/Features_has_feature.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    'Features',\n    'has_feature',\n    array (\n        'name' => 'autossl',\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}"}],"tags":["Features","cPanel Features"]}}},"x-tagGroups":[{"tags":["cPanel Features"],"name":"cPanel Account"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Features","description":"The Features module for UAPI."},{"name":"cPanel Features","description":"cPanel Account / cPanel Features"}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}},"CSVImport":{"doimport":{"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/CSVImport/doimport":{"get":{"parameters":[{"description":"The unique ID of the import operation. The cPanel API 2 CSVImport::uploadimport function generates this ID and stores it in the `CPVAR` attribute named `csvimportid`.","schema":{"type":"string","example":"Leq58oid3sF3Moye3_YbJGqoMvCb7M4j"},"name":"id","in":"query","required":"true"},{"in":"query","name":"type","required":"true","description":"The type of email address to add.\n\n* `email` — A regular email account.\n* `fwd` — A forwarder.","schema":{"type":"string","example":"email","enum":["email","fwd"]}},{"schema":{"type":"string","example":"example.com","format":"domain"},"description":"The domain under which to add the email accounts.","required":"true","in":"query","name":"domain"}],"operationId":"CSVImport::doimport","description":"This function imports email accounts from an already uploaded CSV file.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"doimport","description":"The name of the method called."},"module":{"example":"CSVImport","description":"The name of the module called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":["1 error(s) were encountered while importing accounts."],"type":"array"},"status":{"type":"integer","example":"0","enum":["0","1"],"description":"* `1` — Success\n* `0` — Failed: One or more errors occurred. For errors related to individual account add operations, see the `reason` field in each record from `results` for more information."},"data":{"type":"object","properties":{"results":{"example":[{"type":"email","reason":"OK","email":"j.doe@example.com","status":"1"},{"status":"0","reason":"The account jdoe@example.com already exists!","email":"jdoe@example.com","type":"email"}],"description":"The results for each attempted add operation.","items":{"type":"object","properties":{"status":{"enum":["0","1"],"description":"The outcome of each operation.\n\n* `1` — Success.\n* `0` — Failed.","type":"integer"},"fwd":{"format":"email","description":"The destination of the forwarder (if applicable).","example":null,"nullable":"true","type":"string"},"email":{"example":"j.doe@example.com","format":"email","description":"The email address or forwarder.","type":"string"},"reason":{"type":"string","description":"The explanation of the outcome for each operation."},"type":{"enum":["email","fwd"],"example":"email","description":"The type of email address.\n\n* `email` — A regular email account.\n* `fwd` — A forwarder.","type":"string"}}},"type":"array"}}},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"}},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 94","tags":["CSVImport","Email Accounts"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  CSVImport \\\n  doimport \\\n  id='Leq58oid3sF3Moye3_YbJGqoMvCb7M4j' \\\n  type='email' \\\n  domain='example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/CSVImport/doimport?id=Leq58oid3sF3Moye3_YbJGqoMvCb7M4j&type=email&domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file CSVImport_doimport.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/CSVImport_doimport.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/CSVImport/,\n    q/doimport/,\n    {\n        'id' => 'Leq58oid3sF3Moye3_YbJGqoMvCb7M4j',\n        'type' => 'email',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file CSVImport_doimport.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/CSVImport_doimport.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    'CSVImport',\n    'doimport',\n    array (\n        'id' => 'Leq58oid3sF3Moye3_YbJGqoMvCb7M4j',\n        'type' => 'email',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Import email accounts from CSV file"}}},"tags":[{"name":"CSVImport","description":"The CSVImport module for UAPI."},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.93.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}}},"Email":{"disable_spam_box":{"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"paths":{"/Email/disable_spam_box":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"default":null,"nullable":"true","type":"object"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}}},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"disable_spam_box"}}}}}}},"x-cpanel-available-version":"cPanel 70","parameters":[],"description":"This function disables spam box filtering for a cPanel account. When you disable spam box filtering, the system sends all messages to the account's inbox.\n\n**Notes:**\n\n  * This function **requires** that your hosting provider enables Apache SpamAssassin™ on the server.\n  * To **enable** spam box filtering, use the UAPI `Email::enable_spam_box` function.\n  * For more information, read our [Spam Filters](https://go.cpanel.net/cpaneldocsSpamFilters) documentation.\n\n**Important:**\n\n  When you disable the [*Spam Filter* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"disable_spam_box","x-cpanel-api-version":"UAPI","summary":"Disable spam box filtering for cPanel account","tags":["Email","Spam Management"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  disable_spam_box\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/disable_spam_box"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_disable_spam_box.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_disable_spam_box.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/Email/,\n    q/disable_spam_box/\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_disable_spam_box.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_disable_spam_box.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    'Email',\n    'disable_spam_box'\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-tagGroups":[{"name":"Email","tags":["Spam Management"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Spam Management","description":"Email / Spam Management"}]},"get_webmail_settings":{"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"paths":{"/Email/get_webmail_settings":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"get_webmail_settings","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"data":{"type":"object","properties":{"user":{"description":"The email account.","oneOf":[{"format":"email","example":"user@example.com","type":"string"},{"type":"string","format":"username","example":"user"}]},"has_maildir":{"enum":["1"],"example":"1","description":"Whether `Maildir` is enabled for the email account.\n\n* `1` — Enabled.\n\nIt is not possible to disable `Maildir`.","type":"integer"},"domain":{"example":"mail.example.com","description":"The email account's mail server hostname.","format":"domain","type":"string"}}},"metadata":{"properties":{}},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"}},"type":"object"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"get_webmail_settings","description":"This function retrieves an email account's Webmail settings.\n\n**Important:**\n\nWhen you disable the [_Receive Mail_ role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"required":"false","name":"account","in":"query","schema":{"oneOf":[{"example":"user@example.com","format":"email","type":"string"},{"type":"string","example":"user","format":"username"}]},"description":"The email account.\n\n**Note:**\n\nIf you do **not** specify a value, the function retrieves settings for the cPanel account's default mail account."}],"summary":"Return email account's Webmail settings","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_webmail_settings\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_webmail_settings"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_webmail_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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_webmail_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/Email/,\n    q/get_webmail_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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_webmail_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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_webmail_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    'Email',\n    'get_webmail_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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Accounts"]}}},"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}]},"suspend_incoming":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/Email/suspend_incoming":{"get":{"parameters":[{"name":"email","in":"query","required":"false","description":"The email user's account name.","schema":{"type":"string","example":"user@example.com","format":"email"}}],"description":"This function suspends incoming email for an account. The system will reject incoming email while the account is suspended.\n\n**Notes:**\n\n* The user can still log in to the email account. To suspend a user's ability to log in to, send mail from, and read their account, use the UAPI `Email::suspend_login` function.\n* Use the UAPI `Email::unsuspend_incoming` function to allow the account to receive email.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"suspend_incoming","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"suspend_incoming","type":"string"},"result":{"properties":{"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"default":null,"nullable":"true","type":"object"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"Email","description":"The name of the module called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 54","tags":["Email","Email Suspensions"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  suspend_incoming\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/suspend_incoming"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_suspend_incoming.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_suspend_incoming.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/Email/,\n    q/suspend_incoming/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_suspend_incoming.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_suspend_incoming.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    'Email',\n    'suspend_incoming'\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","summary":"Suspend email account incoming (SMTP) mail"}}},"x-tagGroups":[{"tags":["Email Suspensions"],"name":"Email"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Suspensions","description":"Email / Email Suspensions"}]},"get_max_email_quota":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"paths":{"/Email/get_max_email_quota":{"get":{"tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_max_email_quota\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_max_email_quota","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_max_email_quota.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_max_email_quota.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/Email/,\n    q/get_max_email_quota/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_max_email_quota.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_max_email_quota.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    'Email',\n    'get_max_email_quota'\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","summary":"Return email account's max quota size","operationId":"get_max_email_quota","description":"This function retrieves the account's maximum email quota size, in bytes format.\n\n**Important:**\n\n  When you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 11.48","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_max_email_quota"},"result":{"properties":{"data":{"type":"integer","maximum":"4503599627370496","description":"The account's maximum email quota, in bytes format. The function will\nreturn one of the following values:\n\n* The system's default maximum quota (4 [Pebibytes](https://en.wikipedia.org/wiki/Pebibyte)).\n* The account's quota value, if it is **less** than the default\nsystem quota value.","example":"4503599627370496"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed: Check the errors field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"metadata":{"properties":{}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"example":"Email","description":"The name of the module called.","type":"string"}}}}}}}}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"get_default_email_quota":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"paths":{"/Email/get_default_email_quota":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"get_default_email_quota","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"type":"integer","minimum":"0","example":"34359738368","description":"The default email quota in bytes.\n\nThe value will either be:\n* The system's default quota value (32 gigabytes).\n* The account's quota value, if it is less than the system's default value."},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.48","parameters":[],"operationId":"get_default_email_quota","description":"This function retrieves the account's default email quota size, in bytes format.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","summary":"Return email account's default email quota","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_default_email_quota\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_default_email_quota","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_default_email_quota.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_default_email_quota.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/Email/,\n    q/get_default_email_quota/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_default_email_quota.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_default_email_quota.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    'Email',\n    'get_default_email_quota'\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}"}],"tags":["Email","Email Accounts"]}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"count_pops":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Accounts","description":"Email / Email Accounts"}],"paths":{"/Email/count_pops":{"get":{"summary":"Return cPanel account's email account total","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  count_pops\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/count_pops"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_count_pops.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_count_pops.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/Email/,\n    q/count_pops/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_count_pops.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_count_pops.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    'Email',\n    'count_pops'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Email Accounts"],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"data":{"minimum":"0","type":"integer","description":"The number of email accounts.\n* `0`\n* A positive integer.","example":"1"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"Email","description":"The name of the module called."},"func":{"type":"string","example":"count_pops","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function returns the number of [email accounts](https://go.cpanel.net/cpaneldocsEmailAccounts) for a cPanel account.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"count_pops","parameters":[]}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"get_disk_usage":{"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/get_disk_usage":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Email"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"object","properties":{"user":{"type":"string","example":"user","description":"The email account's username."},"diskused":{"type":"number","example":"399.6","description":"The disk space that the email account uses.\n* A positive floating-point value that represents the disk space, used in megabytes (MB).\n* `0` - The account posesses an unlimited disk quota."},"domain":{"type":"string","format":"domain","description":"The email account's domain.","example":"example.com"},"login":{"type":"string","format":"email","description":"The email address or the main account username.","example":"user@example.com"}}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"example":"get_disk_usage","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"required":"true","name":"user","in":"query","schema":{"example":"user","format":"username","type":"string"},"description":"The email account username."},{"description":"The email account's domain.","schema":{"example":"example.com","format":"domain","type":"string"},"name":"domain","in":"query","required":"true"}],"description":"This function retrieves the disk space that an email account uses.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"get_disk_usage","x-cpanel-api-version":"UAPI","summary":"Return email account's disk usage","tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_disk_usage \\\n  user='user' \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_disk_usage?user=user&domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_disk_usage.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_disk_usage.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/Email/,\n    q/get_disk_usage/,\n    {\n        'user' => 'user',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_disk_usage.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_disk_usage.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    'Email',\n    'get_disk_usage',\n    array (\n        'user' => 'user',\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}"}]}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2"},"delete_filter":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Email/delete_filter":{"get":{"summary":"Delete email account's email filter","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  delete_filter \\\n  account='user@example.com' \\\n  filtername='coffee'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/delete_filter?account=user%40example.com&filtername=coffee","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_delete_filter.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_delete_filter.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/Email/,\n    q/delete_filter/,\n    {\n        'account' => 'user@example.com',\n        'filtername' => 'coffee',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_delete_filter.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_delete_filter.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    'Email',\n    'delete_filter',\n    array (\n        'account' => 'user@example.com',\n        'filtername' => 'coffee',\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}"}],"tags":["Email","Email Filtering"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"type":"object","nullable":"true","default":null},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"description":"The name of the method called.","example":"delete_filter","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"name":"account","in":"query","required":"true","description":"The email address that owns the filter.","schema":{"example":"user@example.com","format":"email","type":"string"}},{"description":"The filter's name.","schema":{"type":"string","example":"coffee"},"in":"query","name":"filtername","required":"true"}],"description":"This function deletes an email filter.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"delete_filter"}}},"x-tagGroups":[{"name":"Email","tags":["Email Filtering"]}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Filtering","name":"Email Filtering"}]},"unset_manual_mx_redirects":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/unset_manual_mx_redirects":{"get":{"description":"This function lets you create a manual Exim mail exchanger (MX) redirect for a domain.\nAn MX redirection lets you bypass the domain's MX lookup via the Domain Name System (DNS).\nThis function adds the manual redirect entries to the `/etc/manualmx` file.\n\n**Note:**\n\n  To remove a domain's manual MX redirection, use the UAPI Email `unset_manual_mx_redirect` function.","operationId":"unset_manual_mx_redirects","parameters":[{"description":"The domain for which to add a manual MX redirect entry.\n\n**Note:**\n\n* To add multiple domain entries, increment the parameter. For example, use the `domain`, `domain-1`, and `domain-2` parameters.\n* For multiple domains, you **must** include its corresponding `mx_host` value.","examples":{"single":{"value":"'example.com'","summary":"Add a single manual MX redirect entry."},"multiple":{"value":"example.com&domain-1=example1.com&domain-2=example2.com","summary":"Add multiple manual MX redirect entries."}},"schema":{"type":"string","format":"domain","example":"example.com"},"name":"domain","in":"query","required":"true"}],"x-cpanel-available-version":"cPanel 96","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"unset_manual_mx_redirects","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"properties":{"additionalProperties":{"type":"string","nullable":"true","example":"mailhostexample.com","description":"The domain for which the function removed the manual MX redirect entry.\n\n* null — The domain did not have a manual MX redirect entry.\n\n**Note:**\n\nThis return's name is the `domain` parameter's value."}},"type":"object","description":"A list of domains and the removed manual MX redirect entries.","example":{"example.com":"mailhostexample.com"}},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null}}},"module":{"type":"string","example":"Email","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty --user=username Email unset_manual_mx_redirects domain='example.com'","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/unset_manual_mx_redirects?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_unset_manual_mx_redirects.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_unset_manual_mx_redirects.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/Email/,\n    q/unset_manual_mx_redirects/,\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_unset_manual_mx_redirects.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_unset_manual_mx_redirects.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    'Email',\n    'unset_manual_mx_redirects',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Remove manual MX redirection"}}}},"list_forwarders_backups":{"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Forwarding","name":"Email Forwarding"}],"paths":{"/Email/list_forwarders_backups":{"get":{"tags":["Email","Email Forwarding"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_forwarders_backups\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_forwarders_backups"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_forwarders_backups.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_forwarders_backups.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/Email/,\n    q/list_forwarders_backups/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_forwarders_backups.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_forwarders_backups.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    'Email',\n    'list_forwarders_backups'\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","summary":"Return domains with domain-level forwarders","parameters":[],"description":"This function lists the domains with domain-level forwarders.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_forwarders_backups","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Email","description":"The name of the module called."},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"data":{"type":"array","items":{"properties":{"domain":{"type":"string","description":"domain that uses a domain-level filter.","format":"domain","example":"example.com"}},"type":"object"}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}}},"func":{"type":"string","description":"The name of the method called.","example":"list_forwarders_backups"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42"}}},"x-tagGroups":[{"tags":["Email Forwarding"],"name":"Email"}],"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"release_outgoing":{"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"paths":{"/Email/release_outgoing":{"get":{"operationId":"release_outgoing","description":"This function sends all of the outgoing mail from Exim's queue for an email account.\n\n**Note:**\n\nTo set Exim to queue all outgoing mail for an email account, use the UAPI `Email::hold_outgoing` function.","parameters":[{"in":"query","name":"email","required":"true","description":"The email account's username.","schema":{"example":"username@example.com","format":"email","type":"string"}}],"x-cpanel-available-version":"cPanel 70","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"data":{"default":null,"nullable":"true","type":"object"},"metadata":{"properties":{}}}},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"type":"string","example":"release_outgoing","description":"The name of the method called."}},"type":"object"}}}}},"tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  release_outgoing \\\n  email='username@example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/release_outgoing?email=username%40example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_release_outgoing.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_release_outgoing.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/Email/,\n    q/release_outgoing/,\n    {\n        'email' => 'username@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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_release_outgoing.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_release_outgoing.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    'Email',\n    'release_outgoing',\n    array (\n        'email' => 'username@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}"}],"x-cpanel-api-version":"UAPI","summary":"Start email account outgoing mail"}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"}},"add_pop":{"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"paths":{"/Email/add_pop":{"get":{"summary":"Create email address","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  add_pop \\\n  email='user' \\\n  password='123456luggage'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/add_pop?email=user&password=123456luggage"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_add_pop.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_add_pop.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/Email/,\n    q/add_pop/,\n    {\n        'email' => 'user',\n        'password' => '123456luggage',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_add_pop.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_add_pop.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    'Email',\n    'add_pop',\n    array (\n        'email' => 'user',\n        'password' => '123456luggage',\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}"}],"tags":["Email","Email Accounts"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"example":"add_pop","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"data":{"type":"string","description":"The email address. The email account username, a plus character (+), and the email account domain.","example":"user+example.com"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"}},"type":"object"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"description":"The email account username or address.\n* A valid email account username. For example, `user` to create `user@example.com`.\n* A valid email address.\n\n**Note:**\n\n  You **cannot** enter `cpanel` as an account name when you create an email account.","schema":{"example":"user","oneOf":[{"format":"email","type":"string"},{"type":"string"}]},"name":"email","in":"query","required":"true"},{"in":"query","name":"password","required":"true","description":"The email account password.","schema":{"example":"123456luggage","type":"string"}},{"schema":{"type":"string","example":"example.com","default":"The cPanel account's main domain.","format":"domain"},"description":"The email account's domain. For example, `example.com` to create `user@example.com`.","required":"false","name":"domain","in":"query"},{"name":"quota","in":"query","required":"false","description":"The maximum amount of disk space that the new email account may use.\n* A positive integer that represents the maximum amount of disk space, in megabytes (MB).\n* `0` or `unlimited` — The account possesses unlimited disk space.\n\n**Note:**\n\n  * The positive integer value **cannot** exceed the maximum email quota.\n  * The `0` or `unlimited` value is **only** available to users **without** a maximum email account quota.","schema":{"oneOf":[{"enum":["unlimited"],"type":"string"},{"minimum":"0","type":"integer"}],"default":"The defined system value.","example":"500"}},{"required":"false","name":"skip_update_db","in":"query","schema":{"type":"integer","example":"1","enum":["0","1"],"default":"0"},"description":"Whether to skip the update of the email accounts database's cache.\n* `1` — Skip the update.\n* `0` — Perform the update."},{"description":"The account's password hash.\n\n**Notes:**\n\n  * You can use this parameter instead of the `password` parameter. However, you cannot use both `password` and `password_hash` parameters in the same request.\n  * You can find your server's hash type in the `/etc/sysconfig/authconfig` file.","schema":{"example":"$6$1sOyHP5ZDYp3pGUz$R0TSgfPRHfDjT5PP5RJGv39FhiGTNNPvM7IFpCBjXijMmlMZk9yI8T3LqGuntc9fdKb5eX.lGL7wBS9e4DAWn/","type":"string"},"name":"password_hash","in":"query","required":"false"},{"schema":{"type":"integer","enum":["0","1"],"example":"0","default":"0"},"description":"Whether to send client configuration instructions to the account.\n* `1` — Send the instructions.\n* `0` — Do **not** send the instructions.","required":"false","name":"send_welcome_email","in":"query"}],"description":"This function creates an email address.\n\n**Important:**\n\n  * When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.\n  * We recommend that you use the UAPI `UserManager::create_user` function to create an email address instead of this function. This function is incompatible with [the *Reset Password* feature](https://go.cpanel.net/resetpassdocs).\n  * You **must** URI-encode values when using the CLI.","operationId":"add_pop"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"delete_auto_responder":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Email/delete_auto_responder":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  delete_auto_responder \\\n  email='user@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/delete_auto_responder?email=user%40example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_delete_auto_responder.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_delete_auto_responder.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/Email/,\n    q/delete_auto_responder/,\n    {\n        'email' => 'user@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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_delete_auto_responder.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_delete_auto_responder.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    'Email',\n    'delete_auto_responder',\n    array (\n        'email' => 'user@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}"}],"tags":["Email","Email Accounts"],"summary":"Delete email account's autoresponder","x-cpanel-api-version":"UAPI","operationId":"delete_auto_responder","description":"This function deletes an autoresponder.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","parameters":[{"name":"email","in":"query","required":"true","description":"The email account.","schema":{"format":"email","example":"user@example.com","type":"string"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"delete_auto_responder","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"data":{"type":"object","nullable":"true","default":null},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"metadata":{"properties":{}},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."}}},"module":{"description":"The name of the module called.","example":"Email","type":"string"}}}}}}}}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}]},"account_name":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Accounts","description":"Email / Email Accounts"}],"paths":{"/Email/account_name":{"get":{"operationId":"account_name","description":"This function returns the provided value. This function works with other functions to display form data within a user interface.\n\n**Note:**\n\n  If you call this function from a Webmail session URL, the system will **only** access data for that email account.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"required":"false","in":"query","name":"account","schema":{"type":"string","example":"user"},"description":"The function will return this value in the data return. If you do **not** include this parameter, the function returns `All Mail On The Account` or a blank value.\n* A valid string.\n* An empty value.\n\n**Note:**\n\n The function does **not** validate this parameter's value."},{"schema":{"example":"any_value","type":"string"},"description":"Include this parameter to cause the function to return `All Mail On The Account` if the account parameter is blank or does not exist. If you do **not** include this parameter and the account value is blank or does not exist, the function returns a blank data value.","required":"false","in":"query","name":"display"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"type":"string","format":"email","description":"The account parameter's value.\n* A valid string.\n* `All Mail On The Account`\n* An empty value.","example":"user@example.com"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"description":"The name of the method called.","example":"account_name","type":"string"}}}}}}},"tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  account_name\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/account_name"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_account_name.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_account_name.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/Email/,\n    q/account_name/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_account_name.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_account_name.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    'Email',\n    'account_name'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return current user's account name"}}},"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}]},"add_domain_forwarder":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["Email Forwarding"],"name":"Email"}],"paths":{"/Email/add_domain_forwarder":{"get":{"tags":["Email","Email Forwarding"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  add_domain_forwarder \\\n  domain='example.com' \\\n  destdomain='forwardtome.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/add_domain_forwarder?domain=example.com&destdomain=forwardtome.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_add_domain_forwarder.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_add_domain_forwarder.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/Email/,\n    q/add_domain_forwarder/,\n    {\n        'domain' => 'example.com',\n        'destdomain' => 'forwardtome.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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_add_domain_forwarder.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_add_domain_forwarder.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    'Email',\n    'add_domain_forwarder',\n    array (\n        'domain' => 'example.com',\n        'destdomain' => 'forwardtome.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}"}],"x-cpanel-api-version":"UAPI","summary":"Create domain-level forwarder","description":"This function creates a domain-level forwarder.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"add_domain_forwarder","parameters":[{"required":"true","in":"query","name":"domain","schema":{"type":"string","format":"domain","example":"example.com"},"description":"The domain on the cPanel account from which to forward mail."},{"schema":{"type":"string","format":"domain","example":"forwardtome.com"},"description":"The domain to receive forwarded mail.","required":"true","in":"query","name":"destdomain"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"add_domain_forwarder","description":"The name of the method called."},"result":{"type":"object","properties":{"data":{"example":"File updated \"/etc/vdomainaliases/example.com\"","description":"A message of success, or a reason for failure.\n* A message of success that lists the updated `vdomainaliases` file.\n* A reason for failure.","type":"string"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"metadata":{"properties":{}},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"Email","description":"The name of the module called.","type":"string"}}}}},"description":"HTTP Request was successful."}}}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Forwarding","name":"Email Forwarding"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}]},"add_mailman_delegates":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Mailing Lists","description":"Email / Mailing Lists"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Mailing Lists"]}],"paths":{"/Email/add_mailman_delegates":{"get":{"summary":"Add administrators to mailing list","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  add_mailman_delegates \\\n  list='mylist' \\\n  delegates='user@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/add_mailman_delegates?list=mylist&delegates=user%40example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_add_mailman_delegates.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_add_mailman_delegates.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/Email/,\n    q/add_mailman_delegates/,\n    {\n        'list' => 'mylist',\n        'delegates' => 'user@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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_add_mailman_delegates.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_add_mailman_delegates.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    'Email',\n    'add_mailman_delegates',\n    array (\n        'list' => 'mylist',\n        'delegates' => 'user@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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Mailing Lists"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Email"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"data":{"properties":{"delegates":{"type":"array","description":"An array of the mailing list's administrators.","items":{"type":"string","example":"admin@example.com, user@example.com"}},"metadata":{"properties":{"transformed":{}},"type":"object"}},"type":"object"},"metadata":{"properties":{}}},"type":"object"},"func":{"description":"The name of the method called.","example":"add_mailman_delegates","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"required":"true","name":"list","in":"query","schema":{"example":"mylist","type":"string"},"description":"The mailing list."},{"examples":{"multiple":{"value":"delegates=user@example.com,admin@example.com","summary":"Multiple delegates"},"single":{"value":"user@example.com","summary":"A single delegate."}},"explode":"false","schema":{"type":"string"},"name":"delegates","in":"query","required":"true","style":"form","description":"A list of the administrators to add.\n\n**Note:**\n\n  Separate multiple email addresses with commas."}],"description":"This function grants mailing list administrative privileges to users.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"add_mailman_delegates"}}}},"export_lists":{"paths":{"/Email/export_lists":{"get":{"tags":["Email","Mailing Lists"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  export_lists\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/export_lists"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account, where theme-name represents\n# jupiter.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_export_lists.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_export_lists.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/Email/,\n    q/export_lists/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account, where theme-name represents\n// jupiter.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_export_lists.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_export_lists.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    'Email',\n    'export_lists'\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","summary":"Export cPanel account's Mailman mailing lists to a file","operationId":"export_lists","description":"This function exports a cPanel account's Mailman mailing lists into a CSV file.\nThis file is located in mail/exported_lists under the user's home directory.","parameters":[],"x-cpanel-available-version":"cPanel 11.114","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","items":{"type":"string"},"type":"array"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"type":"object","nullable":"true"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"example":"export_lists","description":"The name of the method called.","type":"string"}}}}}}}}}},"x-tagGroups":[{"name":"Email","tags":["Mailing Lists"]}],"servers":[{"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."}},"description":"A server running cPanel."}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Mailing Lists","description":"Email / Mailing Lists"}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.114.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"get_lists_total_disk_usage":{"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Mailing Lists","description":"Email / Mailing Lists"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Mailing Lists"]}],"paths":{"/Email/get_lists_total_disk_usage":{"get":{"summary":"Return cPanel account's mailing list disk usage","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_lists_total_disk_usage\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_lists_total_disk_usage","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_lists_total_disk_usage.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_lists_total_disk_usage.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/Email/,\n    q/get_lists_total_disk_usage/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_lists_total_disk_usage.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_lists_total_disk_usage.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    'Email',\n    'get_lists_total_disk_usage'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Mailing Lists"],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"Email","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"example":"1024","description":"The total disk usage for the [mailing lists](https://go.cpanel.net/MailingLists) of a cPanel account, in bytes.","type":"integer","minimum":"0"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"example":"get_lists_total_disk_usage","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"operationId":"get_lists_total_disk_usage","description":"This function returns the total disk usage for the [mailing lists](https://go.cpanel.net/cpaneldocsMailingLists) of a cPanel account.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[]}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI","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/","version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"disable_spam_assassin":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"name":"Email","tags":["Spam Management"]}],"paths":{"/Email/disable_spam_assassin":{"get":{"summary":"Disable Apache SpamAssassin for cPanel account","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  disable_spam_assassin\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/disable_spam_assassin"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_disable_spam_assassin.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_disable_spam_assassin.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/Email/,\n    q/disable_spam_assassin/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_disable_spam_assassin.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_disable_spam_assassin.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    'Email',\n    'disable_spam_assassin'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Spam Management"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"disable_spam_assassin"},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":["Apache SpamAssassin™ has been disabled."],"type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"default":null,"nullable":"true","type":"object"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[],"description":"This function disables Apache SpamAssassin™ for a cPanel account.\n\n**Important:**\n\n  When you disable the [*Spam Filter* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"disable_spam_assassin"}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Spam Management","name":"Spam Management"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"get_client_settings":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/get_client_settings":{"get":{"operationId":"get_client_settings","description":"This function retrieves an email account's client settings.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"type":"string","example":"username@example.com","format":"email"},"description":"The email address for which to send client settings.\n\n**Note:**\n\nThis parameter defaults to the [system default email account](https://go.cpanel.net/systemdefaultemailaccount). ","required":"false","name":"account","in":"query"}],"x-cpanel-available-version":"cPanel 62","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"get_client_settings","description":"The name of the method called.","type":"string"},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"result":{"properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"data":{"type":"object","properties":{"inbox_service":{"type":"string","example":"imap","enum":["imap","pop"],"description":"The service type that the account uses.\n* `imap`\n* `pop`"},"has_plaintext_authentication":{"type":"integer","description":"Whether the account supports plaintext authentication.\n\n* `1` — Supported.\n* `0` — **Not** supported.","enum":["1","0"],"example":"1"},"inbox_port":{"description":"The account's secure inbound port.","example":"993","minimum":"1","type":"integer","maximum":"65535"},"smtp_username":{"type":"string","example":"username@example.com","format":"email","description":"The account's SMTP username."},"inbox_username":{"description":"The account's username.","format":"email","example":"username@example.com","type":"string"},"smtp_insecure_port":{"type":"integer","maximum":"65535","minimum":"1","description":"The account's insecure outbound SMTP port.","example":"25"},"mail_domain":{"type":"string","example":"mail.example.com","format":"domain","description":"The account's mail hostname."},"account":{"format":"email","description":"The account's email address.","example":"username@example.com","type":"string"},"domain":{"format":"domain","description":"The account's domain name.","example":"domain.com","type":"string"},"activesync_available":{"example":"1","enum":["1","0"],"description":"Whether the account supports ActiveSync.\n* `1` — Supported.\n* `0` — **Not** supported.","type":"integer"},"smtp_port":{"maximum":"65535","type":"integer","minimum":"1","example":"465","description":"The account's secure outbound SMTP port."},"display":{"type":"string","example":"username@example.com","format":"email","description":"The account's display name."},"from_archiving":{"description":"Whether the account is a mail archive.\n* `1` — The account is a mail archive.\n* `0` — The account is **not** a mail archive.","enum":["1","0"],"example":"0","type":"integer"},"activesync_host":{"format":"domain","description":"The account's ActiveSync hostname.\n\nThis return **only** appears if `activesync_available` is `1`.","example":"mail.example.com","type":"string"},"inbox_host":{"format":"domain","description":"The account's hostname.","example":"mail.example.com","type":"string"},"smtp_host":{"type":"string","example":"mail.example.com","format":"domain","description":"The account's outbound SMTP hostname."},"inbox_insecure_port":{"type":"integer","maximum":"65535","minimum":"1","description":"The account's insecure inbound port.","example":"143"},"activesync_port":{"minimum":"1","maximum":"65535","type":"integer","example":"2091","description":"The account's ActiveSync SSL/TLS port.\n\nThis return **only** appears if `activesync_available` is `1`."},"activesync_username":{"example":"username@example.com","description":"The account's ActiveSync username.\n\nThis return **only** appears if `activesync_available` is `1`.","format":"email","type":"string"}}},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}}}},"tags":["Email","Email Accounts"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_client_settings\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_client_settings","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_client_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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_client_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/Email/,\n    q/get_client_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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_client_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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_client_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    'Email',\n    'get_client_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","summary":"Return email account's client settings"}}}},"delete_domain_forwarder":{"x-tagGroups":[{"tags":["Email Forwarding"],"name":"Email"}],"paths":{"/Email/delete_domain_forwarder":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"metadata":{"properties":{}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null},"data":{"nullable":"true","default":null,"type":"object"},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"example":"delete_domain_forwarder","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"in":"query","name":"domain","required":"true","description":"The domain name.","schema":{"type":"string","example":"example.com","format":"domain"}}],"description":"This function deletes a domain-level forwarder.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"delete_domain_forwarder","x-cpanel-api-version":"UAPI","summary":"Delete domain-level forwarder","tags":["Email","Email Forwarding"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  delete_domain_forwarder \\\n  domain='example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/delete_domain_forwarder?domain=example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_delete_domain_forwarder.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_delete_domain_forwarder.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/Email/,\n    q/delete_domain_forwarder/,\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_delete_domain_forwarder.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_delete_domain_forwarder.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    'Email',\n    'delete_domain_forwarder',\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}"}]}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Forwarding","description":"Email / Email Forwarding"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"set_default_address":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface’s features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"openapi":"3.0.2","x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"paths":{"/Email/set_default_address":{"get":{"parameters":[{"required":"false","in":"query","name":"domain","schema":{"type":"string","format":"domain","example":"example.com"},"description":"The domain whose default email behavior you want to configure.\n\n**Note**:\n\n  This parameter defaults to the cPanel account’s main domain."},{"description":"The method to use to handle unroutable mail.\n* `fwd` — Forward messages to the `fwdemail` parameter’s address.\n* `fail` — Bounce messages back to the sender, and include the `failmsgs` parameter’s failure message.\n* `blackhole` — Send messages to the `/dev/null/` directory. This method does **not** generate a failure notice.\n* `pipe` — Pipe mail to the `pipefwd` parameter’s application. This parameter requires the [File Storage role](https://go.cpanel.net/serverroles).","schema":{"enum":["fwd","fail","blackhole","pipe"],"example":"fwd","type":"string"},"in":"query","name":"fwdopt","required":"true"},{"schema":{"format":"email","example":"admin@example.com","type":"string"},"description":"The email address to which the system forwards messages.\n\n**Note**:\n\n Use this parameter if you used the `fwd` method for the `fwdopt` parameter.","required":"false","name":"fwdemail","in":"query"},{"name":"failmsgs","in":"query","required":"false","description":"The failure message for the message’s sender.\n\n**Note**:\n\n Use this parameter if you used the `fail` method for the `fwdopt` parameter.","schema":{"type":"string","default":"No such person at this address","example":"Failure echos loud. That address does not exist. Softly I regret. - an email failure haiku"}},{"schema":{"example":"mailscript.pl","type":"string"},"description":"The application to which the system pipes messages.\n\n**Note**:\n\n  Use this parameter if you used the `pipe` method for the `fwdopt` parameter.\n\n**Important**:\n\n  This parameter requires the [File Storage role](https://go.cpanel.net/serverroles).","required":"false","in":"query","name":"pipefwd"}],"operationId":"set_default_address","description":"This function configures a default (catchall) email address.\n\n**Important**:\n\n  When you disable the [Mail Receive role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"set_default_address"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"- `1` — Success.\n- `0` — Failed. Check the `errors` field for more details.","type":"integer"},"data":{"description":"An array of hashes of forwarder information. This array of hashes includes the domain and dest returns.","items":{"properties":{"domain":{"type":"string","description":"The domain. A valid domain on the account.","example":"example.com"},"dest":{"type":"string","example":"admin@example.com","description":"The destination to which the system sends unroutable mail.\n- An email address  The system forwards mail to this address.\n- :fail:  The system bounces mail back to the sender, and sends a failure message.\n- :blackhole:  The system deletes mail without a failure message.\n- The path to an application  The system pipes mail to this application."}},"type":"object"},"type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"}}}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  set_default_address \\\n  fwdopt='fwd'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/set_default_address?fwdopt=fwd"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_set_default_address.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_set_default_address.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/Email/,\n    q/set_default_address/,\n    {\n        'fwdopt' => 'fwd',\n    }\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_set_default_address.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_set_default_address.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    'Email',\n    'set_default_address',\n    array (\n        'fwdopt' => 'fwd',\n    )\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Create default email address"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}]},"get_max_email_quota_mib":{"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"paths":{"/Email/get_max_email_quota_mib":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_max_email_quota_mib\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_max_email_quota_mib","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_max_email_quota_mib.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_max_email_quota_mib.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/Email/,\n    q/get_max_email_quota_mib/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_max_email_quota_mib.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_max_email_quota_mib.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    'Email',\n    'get_max_email_quota_mib'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Email Accounts"],"summary":"Return email account's max quota size in MiB","x-cpanel-api-version":"UAPI","parameters":[],"operationId":"get_max_email_quota_mib","description":"This function retrieves the account's maximum email account quota size, in\n[Mebibytes (MiB)](https://en.wikipedia.org/wiki/Mebibyte) format.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/howtouseserverprofiles#roles),\nthe system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"get_max_email_quota_mib","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{}},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","enum":["1","0"],"example":"1"},"data":{"description":"The account's maximum email account quota size, in Mebibytes (MiB).","example":"4294967296","minimum":"0","type":"integer","maximum":"4294967296"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}},"module":{"description":"The name of the module called.","example":"Email","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.48"}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"}},"passwd_pop":{"paths":{"/Email/passwd_pop":{"get":{"parameters":[{"required":"true","in":"query","name":"email","schema":{"anyOf":[{"format":"email","example":"username@example.com","type":"string"},{"example":"username","format":"username","type":"string"}]},"example":"username@example.com","description":"The email account username or address."},{"schema":{"example":"12345luggage","type":"string"},"description":"The email account password.","required":"true","name":"password","in":"query"},{"required":"false","name":"domain","in":"query","schema":{"type":"string","example":"example.com","default":"the cPanel account's main domain","format":"domain"},"description":"The email account's domain."}],"description":"This function changes an email account's password.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"passwd_pop","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"metadata":{"properties":{}}}},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"passwd_pop","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  passwd_pop \\\n  email='username@example.com' \\\n  password='12345luggage'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/passwd_pop?email=username%40example.com&password=12345luggage","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_passwd_pop.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_passwd_pop.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/Email/,\n    q/passwd_pop/,\n    {\n        'email' => 'username@example.com',\n        'password' => '12345luggage',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_passwd_pop.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_passwd_pop.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    'Email',\n    'passwd_pop',\n    array (\n        'email' => 'username@example.com',\n        'password' => '12345luggage',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Update email account password"}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"disable_filter":{"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/Email/disable_filter":{"get":{"tags":["Email","Email Filtering"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  disable_filter \\\n  account='user@example.com' \\\n  filtername='coffee'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/disable_filter?account=user%40example.com&filtername=coffee"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_disable_filter.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_disable_filter.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/Email/,\n    q/disable_filter/,\n    {\n        'account' => 'user@example.com',\n        'filtername' => 'coffee',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_disable_filter.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_disable_filter.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    'Email',\n    'disable_filter',\n    array (\n        'account' => 'user@example.com',\n        'filtername' => 'coffee',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Disable email filter for email account","parameters":[{"schema":{"type":"string","example":"user@example.com","format":"email"},"description":"The email address that owns the filter.","required":"true","name":"account","in":"query"},{"schema":{"example":"coffee","type":"string"},"description":"The filter's name.","required":"true","in":"query","name":"filtername"}],"description":"This function disables an email filter.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"disable_filter","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","example":"disable_filter","description":"The name of the method called."},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"type":"object","properties":{"filtername":{"example":"coffee","description":"The filter's name. The filtername input parameter's value.","type":"string"},"updated":{"type":"integer","description":"Whether the function updated the filter.\n* `1` - Updated,\n* `0` - Did **not** update.","example":"1","enum":["0","1"]}}},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"}}}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"x-tagGroups":[{"tags":["Email Filtering"],"name":"Email"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Filtering","description":"Email / Email Filtering"}]},"get_spam_settings":{"x-tagGroups":[{"name":"Email","tags":["Spam Management"]}],"paths":{"/Email/get_spam_settings":{"get":{"parameters":[{"in":"query","name":"account","required":"false","description":"Retrieve a specific user account's SpamAssassin settings.\n\n**Note:**\n\nIf you do **not** specify this parameter, the function returns the settings for [the default email account](https://go.cpanel.net/DefaultAddress).","schema":{"example":"username@example.com","format":"email","type":"string"}}],"operationId":"get_spam_settings","description":"This function retrieves the Apache SpamAssassin™ settings for the account.\n\n**Important:**\n\nWhen you disable the [SpamFilter role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"type":"object","properties":{"rewrites_subjects":{"description":"Whether the user's spam filter rewrites the subject lines of spam messages.\n\n* `1` -  Rewrite.\n* `0` -  No rewrites.","enum":["0","1"],"example":"1","type":"integer"},"spam_as_acl":{"example":"1","enum":["1"],"description":"Whether the user's spam filter uses Apache SpamAssassin as an ACL.\n\n**NOTE:**\n\nThe value of this parameter is **always** `1`\n* `1` -  SpamAssassin is an ACL.","type":"integer"},"spam_auto_delete_score":{"type":"integer","minimum":"0","nullable":"true","description":"Displays the user's spam filter threshold.  For more information, see `Email::add_spam_filter`.\n\n**Note:**\n\nThis key does **not** appear if the `cpuser_spam_auto_delete_score` key appears","example":"8"},"spam_status_changeable":{"example":"1","enum":["0","1"],"description":"Whether the server allows cPanel users to configure Apache SpamAssassin settings.\n\n* `1` -  Allowed.\n* `0` -  Not allowed.","type":"integer"},"cpuser_spam_auto_delete":{"nullable":"true","example":"1","enum":["0","1"],"description":"The cPanel user's account-wide spam filter setting\n\n* `1` - Enabled.\n* `0` - Not enabled.\n\n**NOTE:**\n\nThis key **only** appears if the `account` parameter is passed **and** the account does **not** have a custom setting","type":"integer"},"cpuser_spam_auto_delete_score":{"type":"integer","minimum":"0","nullable":"true","description":"The cPanel user's account-wide spam filter threshold score. For more information, see `Email::add_spam_filter`.\n\n**NOTE:**\n\nThis key **only** appears if the `account` parameter is passed **and** the account does **not** have a custom setting","example":"8"},"spam_auto_delete":{"example":"0","enum":["0","1"],"description":"Whether the user's autodelete function is enabled.\n\n* `1` -  Enabled.\n* `0` -  Not enabled.\n\n**NOTE::**\n\nThis key does **not** appear if the `cpuser_spam_auto_delete` key appears","nullable":"true","type":"integer"},"spam_box_enabled":{"type":"integer","description":"Whether the user's spam box is enabled.\n\n* `1` -  Enabled.\n* `0` -  Not enabled.","enum":["0","1"],"example":"0"},"spam_enabled":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the server's global spam filtering is enabled.\n\n* `1` -  Enabled.\n* `0` -  Not enabled.\n\n**Note:**\n\n This value will **only** return `0` if the cPanel user disables Apache SpamAssassin."}}}}},"module":{"type":"string","example":"Email","description":"The name of the module called."},"func":{"example":"get_spam_settings","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_spam_settings\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_spam_settings","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_spam_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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_spam_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/Email/,\n    q/get_spam_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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_spam_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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_spam_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    'Email',\n    'get_spam_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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Spam Management"],"summary":"Return email account Apache SpamAssassin settings","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Spam Management","name":"Spam Management"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"list_mail_domains":{"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/Email/list_mail_domains":{"get":{"parameters":[{"in":"query","name":"select","required":"false","description":"The name of the domain that the function returns with the `select `output parameter. If you do **not** use this parameter, the function will **not** return the `select` parameter with any domains.","schema":{"format":"domain","example":"example.com","type":"string"}},{"required":"false","in":"query","name":"add_www","schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"},"description":"Whether to list `www.` addresses.\n* `1` — List `www.` addresses.\n* `0` — Do **not** list `www.` addresses.\nFor example, if you specify `1`, the function's output would include both `example.com` and `www.example.com`. If you specify `0`, the output would include **only** `example.com`."},{"required":"false","name":"include_wildcard","in":"query","schema":{"default":"0","example":"1","enum":["0","1"],"type":"integer"},"description":"Whether to list wildcard addresses.\n* `1` — List wildcard addresses.\n* `0` — Do **not** list wildcard addresses.\nFor example, if you specify `1`, the function's output would include both `example.com` and `*.example.com`. If you specify `0`, the output would include **only** `example.com`."},{"in":"query","name":"return_temporary_domain","required":"false","description":"Whether to include temporary domains (*.cpanel.site) in the output.\nBy default, temporary domains are excluded.","schema":{"type":"boolean","default":"false"}}],"operationId":"list_mail_domains","description":"This function lists the account's mail domains.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.\n\n**Note:**\n\n  This function **always** returns the account's main domain first.\n\n**Additional Note:**\n\n  By default, temporary domains (*.cpanel.site) are excluded. Use the `return_temporary_domain` parameter to include them.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"list_mail_domains"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"result":{"properties":{"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"items":{"type":"object","properties":{"domain":{"type":"string","description":"The domain name.","format":"domain","example":"example.com"},"select":{"type":"integer","description":"The domain that you specified in the `select` input parameter. The function **only** returns this value if you included the `select` parameter when you called the function.\n\n**Note:**\n\n  Because this value **only** appears if you included the `select` input parameter, The value **always** defaults to `1`.","default":"1","example":"1"}}},"type":"array"}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_mail_domains\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_mail_domains","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_mail_domains.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_mail_domains.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/Email/,\n    q/list_mail_domains/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_mail_domains.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_mail_domains.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    'Email',\n    'list_mail_domains'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return cPanel account's mail domains"}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"servers":[{"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."}},"description":"A server running cPanel."}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Accounts","name":"Email Accounts"}]},"get_charsets":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/get_charsets":{"get":{"tags":["Email","Email Server Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_charsets\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_charsets","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_charsets.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_charsets.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/Email/,\n    q/get_charsets/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_charsets.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_charsets.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    'Email',\n    'get_charsets'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return mail server's supported character encodings","description":"This function lists character encodings that the mail server supports.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"get_charsets","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"description":"An array of [character encodings](https://en.wikipedia.org/wiki/Character_encoding) that the mail server supports.","items":{"example":"utf-8","type":"string"},"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"description":"The name of the method called.","example":"get_charsets","type":"string"}}}}}}}}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Server Information","name":"Email Server Information"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"disable_spam_autodelete":{"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Spam Management","description":"Email / Spam Management"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Spam Management"]}],"paths":{"/Email/disable_spam_autodelete":{"get":{"tags":["Email","Spam Management"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  disable_spam_autodelete\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/disable_spam_autodelete"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_disable_spam_autodelete.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_disable_spam_autodelete.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/Email/,\n    q/disable_spam_autodelete/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_disable_spam_autodelete.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_disable_spam_autodelete.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    'Email',\n    'disable_spam_autodelete'\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","summary":"Disable spam box filtering auto-delete","operationId":"disable_spam_autodelete","description":"This function disables the Apache SpamAssassin™ auto-delete spam feature.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"metadata":{"properties":{}},"data":{"properties":{"spam_auto_delete":{"example":"0","enum":["0"],"description":"Whether the auto-delete spam feature is disabled. `0` is the **only** possible value.","type":"integer"}},"type":"object"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"example":"disable_spam_autodelete","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}}}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}}},"enable_spam_assassin":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/Email/enable_spam_assassin":{"get":{"description":"This function enables Apache SpamAssassin™ for the account.\n\n**Important:**\n\nWhen you disable the [Spam Filter role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"enable_spam_assassin","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"enable_spam_assassin","description":"The name of the method called."},"result":{"properties":{"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"type":"object","default":null,"nullable":"true"},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"Email","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["Email","Spam Management"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  enable_spam_assassin\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/enable_spam_assassin"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_enable_spam_assassin.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_enable_spam_assassin.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/Email/,\n    q/enable_spam_assassin/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_enable_spam_assassin.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_enable_spam_assassin.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    'Email',\n    'enable_spam_assassin'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Enable Apache SpamAssassin for cPanel account"}}},"x-tagGroups":[{"tags":["Spam Management"],"name":"Email"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Spam Management","description":"Email / Spam Management"}]},"edit_pop_quota":{"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"paths":{"/Email/edit_pop_quota":{"get":{"x-cpanel-api-version":"UAPI","summary":"Update email account's quota","tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  edit_pop_quota \\\n  email='user' \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/edit_pop_quota?email=user&domain=example.com","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_edit_pop_quota.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_edit_pop_quota.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/Email/,\n    q/edit_pop_quota/,\n    {\n        'email' => 'user',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_edit_pop_quota.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_edit_pop_quota.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    'Email',\n    'edit_pop_quota',\n    array (\n        'email' => 'user',\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"data":{"type":"object","default":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"func":{"description":"The name of the method called.","example":"edit_pop_quota","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"description":"The email account username.","schema":{"type":"string","example":"user"},"name":"email","in":"query","required":"true"},{"description":"The email account's domain. Defaults to the cPanel account's main domain.","schema":{"example":"example.com","format":"domain","type":"string"},"in":"query","name":"domain","required":"true"},{"description":"The maximum amount of disk space that the new email account may use. Defaults to the system value.\n* A positive integer that represents the maximum amount of disk space, in megabytes (MB).\n\n**Note:**\n\nYou **cannot** enter a value that exceeds the maximum email quota.\n* `0` or `unlimited` — The account possesses unlimited disk space.\n\nIf the email account's quota value is set higher (or unlimited) than\nthe account's max quota, the account's max quota will be applied instead\nof the value entered.\n\n**Note:**\n\nThis value is only available to users without a maximum email account quota.","schema":{"type":"string","example":"500"},"in":"query","name":"quota","required":"false"}],"operationId":"edit_pop_quota","description":"This function changes an email address's quota."}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}}},"list_pops_with_disk":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/list_pops_with_disk":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}},"data":{"type":"array","description":"An array of objects containing data for each email address.","items":{"type":"object","properties":{"_diskused":{"description":"The disk space that the email account uses.\n* A positive value that represents the used disk space, in bytes.\n* `0` - The account possesses an unlimited disk quota.","example":"483","minimum":"0","type":"integer"},"suspended_login":{"enum":["0","1"],"example":"0","description":"Whether the user's ability to log in to, send mail from, and read their email account is suspended.\n* `1` - Suspended.\n* `0` - **Not** suspended.","type":"integer"},"has_suspended":{"example":"0","enum":["0","1"],"description":"Whether the email account possesses one of the following suspension parameters: `suspended_login` `suspended_incoming` `suspended_outgoing` `hold_outgoing`\n* `1` - The email account has a suspension.\n* `0` - The email account does **not** have a suspension.\n\n**Note:**\n\n  The function **only** returns this value if you pass the `get_restrictions=1` parameter.","type":"integer"},"hold_outgoing":{"description":"Whether the email account's outgoing email is held in Exim's queue.\n* `1` - Outgoing email is held in Exim's queue.\n* `0` - Outgoing email is **not** held in Exim's queue.\n\n**Note:**\n\n  The function **only** returns this value if you pass the `get_restrictions=1` parameter.","enum":["0","1"],"example":"0","type":"integer"},"diskused":{"example":"0","description":"The disk space that the email account uses.\n* A positive floating-point value that represents the used disk space, in megabytes (MB).\n* `0` - The account possesses an unlimited disk quota.","minimum":"0","type":"integer"},"suspended_incoming":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether the email account's incoming email is suspended.\n* `1` - Suspended.\n* `0` - **Not** suspended."},"humandiskquota":{"example":"None","description":"The disk quota, in human-readable format.\n* The disk quota and the unit of measure.\n* `None` - The account possesses an unlimited disk quota.","oneOf":[{"type":"integer","minimum":"0"},{"type":"string","enum":["None"]}]},"diskusedpercent20":{"example":"0","description":"The percentage of disk space that the email account uses.\n* A positive value.\n* `0` - The account possesses an unlimited disk quota.","minimum":"0","type":"integer"},"txtdiskquota":{"description":"The email account's disk quota.\n* A positive value that represents the email address's quota, in megabytes (MB).\n* `unlimited` - The email account has an unlimited quota.","example":"unlimited","oneOf":[{"minimum":"0","type":"integer"},{"type":"string","enum":["unlimited"]}]},"suspended_outgoing":{"type":"integer","description":"Whether the email account's outgoing email is suspended.\n* `1` - Suspended.\n* `0` - **Not** suspended.","example":"0","enum":["0","1"]},"diskusedpercent":{"description":"The percentage of disk space that the email account uses.\n* A positive value.\n* `0` - The account has an unlimited disk quota.","example":"0","minimum":"0","type":"integer"},"login":{"oneOf":[{"format":"username","type":"string"},{"type":"string","format":"email"}],"example":"user@example.com","description":"The email address, or the main account username.\n* A valid email address.\n* The username for the main account."},"diskusedpercent_float":{"description":"The floating-point value from which the function derives the `diskusedpercent` return.\n* A floating-point value.\n* `0` - Unlimited or disabled disk quota.\n\n**Note:**\n\n The `diskusedpercent_float` number can contain scientific notation values. For example, `1.20494365692139e-05`.","example":"0","minimum":"0","type":"number"},"email":{"description":"The email address, or the string `Main Account`.\n* A valid email address.\n* `Main Account`","example":"user@example.com","oneOf":[{"format":"email","type":"string"},{"type":"string","enum":["Main Account"]}]},"user":{"type":"string","description":"The email account username. For example, `user` if the email address is `user@example.com`.","example":"user"},"_diskquota":{"minimum":"0","type":"integer","example":"0","description":"The disk quota.\n* A positive value that represents the disk quota, in bytes.\n* `0` - The account possesses an unlimited disk quota."},"humandiskused":{"description":"The disk space that the email account uses, in human-readable format.\n* The disk space that the email account uses, a non-breaking space (`\\u00a0`), and the unit of measure.\n* `None` - The account possesses an unlimited disk quota.","example":"483 bytes","type":"string"},"mtime":{"type":"integer","example":"1415894498","format":"unix_timestamp","description":"The email account's last modification time, in [Unix time](https://wikipedia.org/wiki/Unix_time) format."},"domain":{"example":"example.com","format":"domain","description":"The email account's domain. For example, `example.com` if the email address is `user@example.com`.","type":"string"},"diskquota":{"oneOf":[{"type":"integer","minimum":"0"},{"type":"string"}],"description":"The email account's disk quota.\n* A positive value that represents the email address's quota, in megabytes (MB).\n* `unlimited`, `∞`, or HTML code to display an infinity image - The email account has an unlimited quota.\n\n**Note:**\n\n  The `infinityimg` and `infinitylang` parameters determine the unlimited value for this return.","example":"unlimited"}}}},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"}}},"module":{"type":"string","example":"Email","description":"The name of the module called."},"func":{"description":"The name of the method called.","example":"list_pops_with_disk","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"schema":{"format":"domain","example":"example.com","type":"string"},"description":"A domain name to filter the results by. If you do **not** use this parameter, the function returns **all** of the cPanel account's email addresses.","required":"false","name":"domain","in":"query"},{"schema":{"example":"user","format":"username","type":"string"},"description":"The cPanel user account to query. If you do **not** use this parameter, the function returns the email addresses for **all** cPanel accounts that the user owns.\n\n**Note:**\n\n To retrieve information for a single email address, add the domain parameter. For example, `email=user&domain=example.com` will return information for the email address `user@example.com`.","required":"false","in":"query","name":"email"},{"in":"query","name":"get_restrictions","required":"false","description":"Whether to display restriction status for each of the email addresses.\n* `1` — Display.\n* `0` — Do **not** display.","schema":{"type":"integer","default":"0","enum":["0","1"],"example":"0"}},{"schema":{"type":"string","example":"images/myimg.jpg"},"description":"An image to display for email addresses with an unlimited quota. If you specify an `infinityimg` value, the function returns HTML code to display that image as the `diskquota` parameter's value.","required":"false","in":"query","name":"infinityimg"},{"name":"infinitylang","in":"query","required":"false","description":"Whether to return the `∞` character for email addresses with an unlimited quota.\n* `1` — Return the `∞` character for unlimited `diskquota` values.\n* `0` — Return the string `unlimited` for unlimited `diskquota` values.\n\n**Note:**\n\n If you specify `1` for this parameter **and** the `infinityimg` parameter, the function ignores **this** parameter and returns HTML code for unlimited `diskquota` values.","schema":{"default":"0","enum":["0","1"],"example":"0","type":"integer"}},{"description":"The maximum number of email addresses to return. If you do not use this parameter, the function returns an unlimited number of email addresses.","schema":{"type":"integer","minimum":"1","default":"unlimited","example":"500"},"in":"query","name":"maxaccounts","required":"false"},{"schema":{"type":"integer","default":"0","enum":["0","1"],"example":"0"},"description":"Whether to skip the collection of disk usage information.\n* `1` — Do **not** collect.\n* `0` — Collect.","required":"false","in":"query","name":"no_disk"},{"schema":{"type":"integer","example":"0","enum":["0","1"],"default":"0"},"description":"Whether to skip email database validation.\n* `1` — Skip validation.\n* `0` — Perform the validation.","required":"false","name":"no_validate","in":"query"},{"description":"A [Perl Compatible Regular Expression (PCRE)](https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) that filters the results. For example, `/^[a-z0-9_-]{6,18}$/` matches the local portion of an email address, if it contains between six and 18 characters.","schema":{"type":"string","default":"An empty string","example":"/^[a-z0-9_-]{6,18}$/"},"name":"regex","in":"query","required":"false"}],"description":"This function lists the cPanel account's email accounts with disk information.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_pops_with_disk","summary":"Return email accounts with disk information","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_pops_with_disk\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_pops_with_disk"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_pops_with_disk.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_pops_with_disk.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/Email/,\n    q/list_pops_with_disk/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_pops_with_disk.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_pops_with_disk.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    'Email',\n    'list_pops_with_disk'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Accounts"]}}}},"get_auto_responder":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/get_auto_responder":{"get":{"parameters":[{"description":"The email account name.","schema":{"example":"user","format":"username","type":"string"},"name":"email","in":"query","required":"true"},{"required":"false","in":"query","name":"temp_charset","schema":{"type":"string","example":"utf-8","default":"utf-8"},"description":"The autoresponder's [character set](https://en.wikipedia.org/wiki/Character_encoding)."}],"description":"This function retrieves autoresponder information.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"get_auto_responder","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"data":{"properties":{"from":{"example":"User Name","description":"The contents of the autoresponder message's `From` field.","type":"string"},"is_html":{"example":"1","enum":["0","1"],"description":"Whether the body of the autoresponder message begins with an [HTML content type declaration](https://en.wikipedia.org/wiki/Character_encodings_in_HTML#Specifying_the_document.27s_character_encoding).\n- `1` - Includes an HTML content type declaration.\n- `0` - Does **not** include an HTML content type declaration.","type":"integer"},"subject":{"type":"string","example":"Autoresponder Subject","description":"The contents of the autoresponder message's `Subject` field."},"interval":{"minimum":"0","type":"integer","description":"The amount of time, in hours, that the server waits between autoresponder messages to the same address.\n\n**Note:**\n\nA value of `0` indicates that the system sends a message for each email received.","example":"24"},"stop":{"format":"unix_timestamp","description":"When the autoresponder becomes disabled in Unix time.","example":"1410300000","type":"integer"},"start":{"type":"integer","example":"1410277881","description":"When the autoresponder becomes enabled in Unix time.","format":"unix_timestamp"},"body":{"type":"string","example":"This is an autoresponder message.","description":"The contents of the autoresponder message's `Body` section."},"charset":{"type":"string","description":"The autoresponder's [character set](https://en.wikipedia.org/wiki/Character_encoding).","example":"UTF-8"}},"type":"object"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"description":"The name of the method called.","example":"get_auto_responder","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_auto_responder \\\n  email='user'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_auto_responder?email=user"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_auto_responder.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_auto_responder.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/Email/,\n    q/get_auto_responder/,\n    {\n        'email' => 'user',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_auto_responder.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_auto_responder.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    'Email',\n    'get_auto_responder',\n    array (\n        'email' => 'user',\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}"}],"tags":["Email","Email Accounts"],"summary":"Return email account's autoresponder information","x-cpanel-api-version":"UAPI"}}}},"add_spam_filter":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Spam Management","description":"Email / Spam Management"}],"paths":{"/Email/add_spam_filter":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"type":"object","default":null,"nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"example":"add_spam_filter","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"schema":{"example":"8","default":"5","type":"string","minimum":"1"},"description":"Set a spam score threshold value.\n\n**Notes:**\n\n  * You **must** specify a value greater than `0`, and lower than the domain owner's spam score threshold value.\n  * You **cannot** enter `0` as a value for this parameter.\n  * You can retrieve the domain owner‘s spam score threshold value via the `cpuser_spam_auto_delete_score` return from the UAPI `Email::get_spam_settings` function.\n  * The default value, `5`, is an aggressive spam score.\n  * The lower the spam score, the more likely that Apache SpamAssassin will label messages as spam and delete them.\n  * Some systems may wish to use a more lenient spam score (for example, `8` or `10`).","required":"false","in":"query","name":"required_score"},{"required":"false","name":"account","in":"query","schema":{"type":"string","example":"username@example.com","format":"email"},"description":"The email account to apply a spam score threshold value.\n\n**Note:**\n\n  If you do **not** specify a value, the function applies the new spam score threshold value to **all** accounts."}],"description":"This function sets a new minimum Apache SpamAssassin™ spam score threshold value.\n\n**Notes:**\n\n  * To disable spam filtering, use the UAPI `Email::disable_spam_autodelete` fuction.\n  * For more information, read our [Spam Filters](https://go.cpanel.net/cpaneldocsSpamFilters) documentation.\n\n**Important:**\n\n  * When you disable the [*Spam Filter* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"add_spam_filter","summary":"Update minimum spam score threshold value","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  add_spam_filter\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/add_spam_filter"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_add_spam_filter.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_add_spam_filter.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/Email/,\n    q/add_spam_filter/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_add_spam_filter.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_add_spam_filter.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    'Email',\n    'add_spam_filter'\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}"}],"tags":["Email","Spam Management"]}}},"x-tagGroups":[{"tags":["Spam Management"],"name":"Email"}]},"list_filters":{"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Filtering","name":"Email Filtering"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Email Filtering"],"name":"Email"}],"paths":{"/Email/list_filters":{"get":{"description":"This function lists account-level mail filters. For more information about Exim filters, read [Exim’s documentation](http://www.exim.org/exim-html-3.30/doc/html/filter.html).\n\n**Important**:\n\n  When you disable the [Mail Receive role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_filters","parameters":[{"schema":{"oneOf":[{"format":"email","example":"user@example.com","type":"string"},{"format":"username","example":"username","type":"string"}]},"description":"The email address or cPanel account username for which to return a list of filters. If you do not specify this value, the function lists all of the cPanel account’s account-level filters.","required":"false","in":"query","name":"account"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"data":{"type":"array","items":{"properties":{"actions":{"description":"An array of objects that descibe each of the filter’s actions.","items":{"properties":{"action":{"description":"The filter’s action.\n\nSome common ones include:\n\n* `deliver` — The filter sends mail to the dest address.\n* `fail` — The filter forces a delivery failure.\n* `finish` — The filter stops message processing.\n* `save` — The filter saves mail to the dest file.\n* `pipe` — The filter sends mail to the dest application.\n\nFor more information, read [Exim’s _Filter commands_ documentation](http://www.exim.org/exim-html-3.30/doc/html/filter_11.html).","type":"string"},"dest":{"type":"string","description":"The destination to which the filter sends mail.\n* A file path.\n* An application path.\n* A valid email address.","example":"/dev/null"}},"type":"object"},"type":"array"},"rules":{"items":{"type":"object","properties":{"match":{"description":"The filter’s match type.","enum":["is","matches","contains","does not contain","begins","does not begin","ends","does not end","does not match","is above","is not above","is below","is not below"],"example":"contains","type":"string"},"part":{"example":"$message_body","description":"The queried email section.\n\nSome common ones include:\n\n* `$header_from:` — Matches against the `From:` section.\n* `$header_subject:` — Matches against the `Subject:` section.\n* `$header_to:` — Matches against the `To:` section.\n* `$reply_address:` — Matches against the `Reply To:` section.\n* `$message_body` — Matches against the message’s body.\n* `$message_headers` — Matches against the message’s headers.\n* `foranyaddress $h_to:,$h_cc:,$h_bcc:` —  Matches against all message recipients.\n* `not delivered` — Matches if the system has not queued the message for delivery.\n* `error_message` — Matches if the incoming message bounced.\n\nFor more options, read [Exim’s documentation](https://exim.org/exim-html-3.30/doc/html/filter.html).","type":"string"},"opt":{"example":"or","enum":["and","or","null"],"description":"The connection between multiple conditions.\n  * `and` — Match both conditions.\n  * `or` — Match either condition.\n  * `null` — Only one condition exists.","type":"string"},"val":{"type":"string","description":"The matched value. A string value.","example":"coconut"}}},"description":"An array of objects that descibe each of the filter’s rules.","type":"array"},"enabled":{"type":"integer","description":"Whether the filter is enabled."},"filtername":{"type":"string","description":"The filter’s name.","example":"coffee"},"unescaped":{"type":"boolean","deprecated":"true"}},"type":"object"}},"metadata":{"properties":{}}}},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"type":"string","example":"list_filters","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["Email","Email Filtering"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_filters\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_filters"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_filters.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_filters.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/Email/,\n    q/list_filters/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_filters.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_filters.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    'Email',\n    'list_filters'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return account-level email filters"}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface’s features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"is_integer":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Server Information","description":"Email / Email Server Information."}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/is_integer":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  is_integer\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/is_integer"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_is_integer.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_is_integer.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/Email/,\n    q/is_integer/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_is_integer.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_is_integer.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    'Email',\n    'is_integer'\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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"is_integer","description":"The name of the method called.","type":"string"},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"data":{"type":"object","nullable":"true","default":null},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"type":"string","description":"The name of the module called.","example":"Email"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-internal-only":"true","summary":"Determine if a value is an integer","x-cpanel-api-version":"UAPI","deprecated":"true","tags":["Email Server Information","Email"],"x-cpanel-available-version":"cPanel 11.44 and earlier","parameters":[],"description":"This function is deprecated and does not return useful output.","operationId":"is_integer"}}}},"count_filters":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["Email Filtering"],"name":"Email"}],"paths":{"/Email/count_filters":{"get":{"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"count_filters","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"example":"1","description":"The number of email filters.\n* `0`\n* A positive integer.","minimum":"0","type":"integer"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Email"}}}}},"description":"HTTP Request was successful."}},"description":"This function returns the number of [email filters](https://go.cpanel.net/cpaneldocsEmailFilters) for every email address on a cPanel account.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles) or the [*IP Blocker*](https://go.cpanel.net/whmdocsFeatureManager) feature, the system **disables** this function. For more information, read our [How to Use Server Profiles](https://go.cpanel.net/howtouseserverprofiles) documentation.","operationId":"count_filters","parameters":[],"summary":"Return cPanel account's email filters total","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  count_filters\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/count_filters","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_count_filters.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_count_filters.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/Email/,\n    q/count_filters/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_count_filters.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_count_filters.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    'Email',\n    'count_filters'\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}"}],"tags":["Email","Email Filtering"]}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Filtering","name":"Email Filtering"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}]},"disable_mailbox_autocreate":{"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Server Information","name":"Email Server Information"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/disable_mailbox_autocreate":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"example":"1","enum":["0","1"],"description":"Whether the function disabled mailbox autocreation for the cPanel account.\n* `1` - Mailbox autocreation disabled.\n* `0` - Mailbox autocreation is **not** disabled.","type":"integer"},"metadata":{"properties":{}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"}}},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"example":"disable_mailbox_autocreate","description":"The name of the method called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 78","parameters":[{"in":"query","name":"email","required":"true","description":"The email account address for which to disable mailbox autocreation.","schema":{"type":"string","example":"username@example.com","format":"email"}}],"description":"This function disables the system's ability to automatically create mailboxes for a cPanel account.\n\n**Note:**\n\n  When you **enable** the UAPI's `Email::enable_mailbox_autocreate` function, the system automatically creates mailboxes. The system creates a new mailbox when it receives an email address in [plus address format](https://en.wikipedia.org/wiki/Email_address#Sub-addressing) and that mailbox does **not** exist. For example, receiving an email from the `user+newmailbox@example.com` address creates the `newmailbox` mailbox if the `newmailbox` mailbox does not exist.","operationId":"disable_mailbox_autocreate","summary":"Disable cPanel account mailbox autocreation","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  disable_mailbox_autocreate \\\n  email='username@example.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/disable_mailbox_autocreate?email=username%40example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_disable_mailbox_autocreate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_disable_mailbox_autocreate.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/Email/,\n    q/disable_mailbox_autocreate/,\n    {\n        'email' => 'username@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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_disable_mailbox_autocreate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_disable_mailbox_autocreate.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    'Email',\n    'disable_mailbox_autocreate',\n    array (\n        'email' => 'username@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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Server Information"]}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"remove_mailman_delegates":{"paths":{"/Email/remove_mailman_delegates":{"get":{"description":"This function removes an account's mailing list administrative privileges.","operationId":"remove_mailman_delegates","parameters":[{"description":"The mailing list.","schema":{"example":"mylist","type":"string"},"name":"list","in":"query","required":"true"},{"name":"delegates","in":"query","required":"true","description":"list of the administrators to remove.","schema":{"type":"string","example":"user@example.com,admin@example.com"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"metadata":{"properties":{}},"data":{"properties":{"delegates":{"type":"array","description":"An array of the mailing list's administrators. One or more email addresses.","items":{"example":"secondadmin@example.com","type":"string"}},"metadata":{"properties":{"transformed":{}},"type":"object"}},"type":"object"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","example":"Email","description":"The name of the module called."},"func":{"example":"remove_mailman_delegates","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  remove_mailman_delegates \\\n  list='mylist' \\\n  delegates='user@example.com,admin@example.com'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/remove_mailman_delegates?list=mylist&delegates=user%40example.com%2cadmin%40example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_remove_mailman_delegates.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_remove_mailman_delegates.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/Email/,\n    q/remove_mailman_delegates/,\n    {\n        'list' => 'mylist',\n        'delegates' => 'user@example.com,admin@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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_remove_mailman_delegates.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_remove_mailman_delegates.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    'Email',\n    'remove_mailman_delegates',\n    array (\n        'list' => 'mylist',\n        'delegates' => 'user@example.com,admin@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}"}],"tags":["Email","Mailing Lists"],"summary":"Remove account mailing list admin privileges","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Mailing Lists"],"name":"Email"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Mailing Lists","description":"Email / Mailing Lists"}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"delete_held_messages":{"paths":{"/Email/delete_held_messages":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  delete_held_messages \\\n  email='username@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/delete_held_messages?email=username%40example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_delete_held_messages.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_delete_held_messages.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/Email/,\n    q/delete_held_messages/,\n    {\n        'email' => 'username@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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_delete_held_messages.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_delete_held_messages.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    'Email',\n    'delete_held_messages',\n    array (\n        'email' => 'username@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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Accounts"],"summary":"Delete email account's outgoing messages","x-cpanel-api-version":"UAPI","description":"This function deletes all outbound email messages held in the mail queue for the specified email account.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"delete_held_messages","parameters":[{"schema":{"type":"string","example":"username@example.com","format":"email"},"description":"The email address to query.","required":"true","in":"query","name":"email"}],"x-cpanel-available-version":"cPanel 74","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Email"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"description":"The number of held outbound email messages deleted from the mail queue.\n\n**Note:**\n\n  This function returns a `0` value when no messages exist in the queue.","example":"0","type":"integer","minimum":"0"}}},"func":{"example":"delete_held_messages","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Accounts","name":"Email Accounts"}],"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"list_system_filter_info":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Email/list_system_filter_info":{"get":{"summary":"Return system-level email filter file information","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_system_filter_info\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_system_filter_info","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_system_filter_info.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_system_filter_info.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/Email/,\n    q/list_system_filter_info/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_system_filter_info.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_system_filter_info.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    'Email',\n    'list_system_filter_info'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Email Filtering"],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"data":{"type":"object","properties":{"filter_info":{"type":"string","example":"filter_info.username.yaml.gz","description":"The file that contains the account's system-level filter information. A `.yaml.gz` filename that contains the cPanel account username."}}},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"type":"string","description":"The name of the method called.","example":"list_system_filter_info"}}}}},"description":"HTTP Request was successful."}},"operationId":"list_system_filter_info","description":"This function retrieves a `.yaml.gz` file that contains system-level filter information.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[]}}},"x-tagGroups":[{"tags":["Email Filtering"],"name":"Email"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Filtering","description":"Email / Email Filtering"}]},"check_fastmail":{"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/check_fastmail":{"get":{"parameters":[],"description":"This function checks whether [BlackBerry® FastMail](https://go.cpanel.net/blackberryfastmail) support is enabled.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"check_fastmail","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"check_fastmail"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"metadata":{"properties":{}},"data":{"description":"The contents of the server's `/var/cpanel/fastmail` file.\n* A positive value that represents a BlackBerry FastMail version number if it is enabled on the server.\n* A `null` value if BlackBerry FastMail is not enabled on the server.","example":"2","type":"string"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}},"type":"object"},"module":{"description":"The name of the module called.","example":"Email","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  check_fastmail\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/check_fastmail"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_check_fastmail.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_check_fastmail.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/Email/,\n    q/check_fastmail/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_check_fastmail.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_check_fastmail.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    'Email',\n    'check_fastmail'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Email Server Information"],"summary":"Return BlackBerry FastMail support status","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Server Information","name":"Email Server Information"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"openapi":"3.0.2"},"fts_rescan_mailbox":{"paths":{"/Email/fts_rescan_mailbox":{"get":{"operationId":"fts_rescan_mailbox","description":"This function requests that the IMAP Full-Text Search Indexing (powered by Apache Solr™) plugin rescan an email account.\n\n**Note:**\n\nTo enable this function, you **must** install the *IMAP Full-Text Search Indexing (powered by Apache Solr™)* plugin in WHM's [*Manage Plugins*](https://go.cpanel.net/whmdocsManagePlugins) interface (*WHM >> Home >> cPanel >> Manage Plugins*). For more information, read our [install_dovecot_fts script](https://go.cpanel.net/installdovecotftsscript) documentation.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system disables this function.","parameters":[{"description":"The email user's account name.\n\n**Note:**\n\nIf you do not enter an email address, the function rescans the default email account.","schema":{"type":"string","format":"email","example":"username@example.com"},"name":"account","in":"query","required":"true"}],"x-cpanel-available-version":"cPanel 70","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"fts_rescan_mailbox"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"result":{"type":"object","properties":{"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"data":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the system started the rescan.\n* `1` - Success.\n* `0` - Failure."}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["Email","Email Server Information"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  fts_rescan_mailbox \\\n  account='username@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/fts_rescan_mailbox?account=username%40example.com","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_fts_rescan_mailbox.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_fts_rescan_mailbox.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/Email/,\n    q/fts_rescan_mailbox/,\n    {\n        'account' => 'username@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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_fts_rescan_mailbox.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_fts_rescan_mailbox.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    'Email',\n    'fts_rescan_mailbox',\n    array (\n        'account' => 'username@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}"}],"x-cpanel-api-version":"UAPI","summary":"Start IMAP Full-Text Search scan for email account"}}},"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Server Information","name":"Email Server Information"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"set_list_privacy_options":{"servers":[{"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."}},"description":"A server running cPanel."}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Mailing Lists","description":"Email / Mailing Lists"}],"paths":{"/Email/set_list_privacy_options":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"Email","description":"The name of the module called.","type":"string"},"result":{"properties":{"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"data":{"nullable":"true","default":null,"type":"object"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"type":"string","example":"set_list_privacy_options","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"description":"The mailing list name.","schema":{"example":"mylist","type":"string"},"name":"list","in":"query","required":"true"},{"description":"Whether the Mailman directory page displays the list.\n* `1` - Display.\n* `0` - Does **not** display.","schema":{"example":"1","enum":["0","1"],"type":"integer"},"name":"advertised","in":"query","required":"true"},{"required":"true","name":"archive_private","in":"query","schema":{"enum":["0","1"],"example":"1","type":"integer"},"description":"Whether the mailing list archive is private.\n* `1` - Private.\n* `0` - Public."},{"required":"true","name":"subscribe_policy","in":"query","schema":{"example":"1","enum":["1","2","3"],"type":"integer"},"description":"The level of control that the mailing list administrator has over new subscribers.\n* `1` - Anyone can subscribe. The system sends a confirmation email.\n* `2` - The administrator **must** approve subscriptions. The system does **not** send a confirmation email.\n* `3` - The administrator **must** approve subscriptions. The system sends a confirmation email."}],"operationId":"set_list_privacy_options","description":"This function modifies a Mailman mailing list's privacy options.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","x-cpanel-api-version":"UAPI","summary":"Update mailing list privacy options","tags":["Email","Mailing Lists"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  set_list_privacy_options \\\n  list='mylist' \\\n  advertised='1' \\\n  archive_private='1' \\\n  subscribe_policy='1'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/set_list_privacy_options?list=mylist&advertised=1&archive_private=1&subscribe_policy=1","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_set_list_privacy_options.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_set_list_privacy_options.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/Email/,\n    q/set_list_privacy_options/,\n    {\n        'list' => 'mylist',\n        'advertised' => '1',\n        'archive_private' => '1',\n        'subscribe_policy' => '1',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_set_list_privacy_options.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_set_list_privacy_options.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    'Email',\n    'set_list_privacy_options',\n    array (\n        'list' => 'mylist',\n        'advertised' => '1',\n        'archive_private' => '1',\n        'subscribe_policy' => '1',\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"x-tagGroups":[{"name":"Email","tags":["Mailing Lists"]}],"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"delete_mx":{"paths":{"/Email/delete_mx":{"get":{"description":"This function deletes a Mail Exchanger (MX) record. For more information about MX record settings, read our [Email Routing Configuration](https://go.cpanel.net/whmdocsEmailRoutingConfiguration) documentation.\n\n**Important:**\n\n  When you disable the [DNS role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"delete_mx","parameters":[{"required":"true","in":"query","name":"domain","schema":{"type":"string","format":"domain","example":"example.com"},"description":"The mail exchanger's domain."},{"schema":{"example":"mail.example.com","type":"string"},"description":"The mail exchanger's name.","required":"true","name":"exchanger","in":"query"},{"in":"query","name":"priority","required":"true","description":"The mail exchanger's [priority value](https://go.cpanel.net/whmdocsEditMXEntry). If multiple MX entries match the exchanger value, the system uses this parameter to find the correct entry.","schema":{"minimum":"1","type":"integer","example":"15"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"delete_mx"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"checkmx":{"description":"An object containing the mail exchanger's data.","properties":{"local":{"example":"0","enum":["0","1"],"description":"Whether the mail exchanger is a local exchanger.\n* `1` - Local.\n* `0` - **Not** local.","type":"integer"},"secondary":{"type":"integer","description":"Whether the mail exchanger is a secondary exchanger.\n* `1` - Secondary.\n* `0` - **Not** secondary.","enum":["0","1"],"example":"0"},"isprimary":{"example":"0","enum":["0","1"],"description":"Whether the mail exchanger is the primary mail exchanger.\n* `1` - Primary.\n* `0` - **Not** primary.","type":"integer"},"detected":{"description":"The mail exchanger type.\n* `auto`\n* `local`\n* `secondary`\n* `remote`","enum":["auto","local","secondary","remote"],"example":"auto","type":"string"},"mxcheck":{"example":"auto","enum":["auto","local","secondary","remote"],"description":"The mail exchanger type.\n* `auto`\n* `local`\n* `secondary`\n* `remote`","type":"string"},"issecondary":{"type":"integer","description":"Whether the mail exchanger is a secondary exchanger.\n* `1` - Secondary.\n* `0` - **Not** secondary.","enum":["0","1"],"example":"0"},"warnings":{"example":"Auto Detect of MX configuration not possible due to non-resolving MX entries. Defaulting to last known setting: local.","description":"Warning messages, if any exist.","items":{"type":"string"},"type":"string"},"remote":{"description":"Whether the mail exchanger is a remote exchanger.\n* `1` - Remote.\n* `0` - **Not** remote.","example":"0","enum":["0","1"],"type":"integer"},"changed":{"type":"integer","description":"Whether a change occurred during the function.\n* `1` - Change occurred.\n* `0` - **No** change.","enum":["0","1"],"example":"1"}},"type":"object"},"statusmsg":{"type":"string","description":"A message of success, or an error message.\n* A message of success that begins with Added entry.\n* An error message.","example":"Removed entry: example.com. IN MX 15 mail.example.com\nBind reloading on example using rndc zone: [example.com]"},"status":{"enum":["0","1"],"example":"1","description":"Whether the function succeeded.\n* `1` - Success.\n* `0` - Failure.","type":"integer"},"results":{"type":"string","description":"A message of success, or an error message.\n* A message of success that begins with `Removed entry:`.\n* An error message.","example":"Removed entry: example.com. IN MX 15 mail.example.com\nBind reloading on example using rndc zone: [example.com]"}}},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"],"type":"integer"}}},"module":{"type":"string","example":"Email","description":"The name of the module called."}}}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  delete_mx \\\n  domain='example.com' \\\n  exchanger='mail.example.com' \\\n  priority='15'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/delete_mx?domain=example.com&exchanger=mail.example.com&priority=15"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_delete_mx.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_delete_mx.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/Email/,\n    q/delete_mx/,\n    {\n        'domain' => 'example.com',\n        'exchanger' => 'mail.example.com',\n        'priority' => '15',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_delete_mx.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_delete_mx.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    'Email',\n    'delete_mx',\n    array (\n        'domain' => 'example.com',\n        'exchanger' => 'mail.example.com',\n        'priority' => '15',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email DNS Settings"],"summary":"Delete mail exchanger record","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"DNS / Email DNS Settings","name":"Email DNS Settings"}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"passwd_list":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Mailing Lists","name":"Mailing Lists"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"x-tagGroups":[{"tags":["Mailing Lists"],"name":"Email"}],"paths":{"/Email/passwd_list":{"get":{"summary":"Update mailing list password","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  passwd_list \\\n  list='mylist@example.com' \\\n  password='12345luggage'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/passwd_list?list=mylist%40example.com&password=12345luggage","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_passwd_list.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_passwd_list.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/Email/,\n    q/passwd_list/,\n    {\n        'list' => 'mylist@example.com',\n        'password' => '12345luggage',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_passwd_list.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_passwd_list.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    'Email',\n    'passwd_list',\n    array (\n        'list' => 'mylist@example.com',\n        'password' => '12345luggage',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Mailing Lists"],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"passwd_list","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"data":{"type":"object","default":null,"nullable":"true"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}}}},"module":{"description":"The name of the module called.","example":"Email","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function changes a mailing list's password.\n\n**Important:**\n\nWhen you disable the [_Receive Mail_](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"passwd_list","parameters":[{"in":"query","name":"list","required":"true","description":"The full name (including the domain) of a Mailman mailing list on the cPanel account.","schema":{"type":"string","example":"mylist@example.com"}},{"description":"The new password.","schema":{"type":"string","example":"12345luggage"},"name":"password","in":"query","required":"true"}]}}}},"change_mx":{"tags":[{"description":"DNS / Email DNS Settings","name":"Email DNS Settings"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"paths":{"/Email/change_mx":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"change_mx","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"data":{"properties":{"statusmsg":{"description":"A message of success, or an error message.\n* A message of success that begins with `Added entry:`.\n* An error message.","example":"Replacing existing entry on line matched old entry and old priority: 51:\\nBind reloading on example using rndc zone: [example.com]","type":"string"},"status":{"example":"1","enum":["0","1"],"description":"Whether the function succeeded.\n* `1` - Success.\n* `0` - Failure.","type":"integer"},"checkmx":{"properties":{"changed":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether a change occurred during the function.\n* `1` - Change occurred.\n* `0` - **No** change."},"remote":{"type":"integer","description":"Whether the mail exchanger is a remote exchanger.\n* `1` - Remote.\n* `0` - **Not** remote.","enum":["0","1"],"example":"0"},"warnings":{"type":"array","items":{"example":"Auto Detect of MX configuration not possible due to non-resolving MX entries. Defaulting to last known setting: local.","type":"string"},"description":"Warning messages, if any exist."},"mxcheck":{"type":"string","description":"The mail exchanger type.\n* `auto`\n* `local`\n* `secondary`\n* `remote`","example":"auto","enum":["auto","local","secondary","remote"]},"issecondary":{"description":"Whether the mail exchanger is a secondary exchanger.\n* `1` - Secondary.\n* `0` - **Not** secondary.","example":"0","enum":["0","1"],"type":"integer"},"secondary":{"example":"0","enum":["0","1"],"description":"Whether the mail exchanger is a secondary exchanger.\n* `1` - Secondary.\n* `0` - **Not** secondary.","type":"integer"},"isprimary":{"example":"0","enum":["0","1"],"description":"Whether the mail exchanger is the primary mail exchanger.\n* `1` - Primary.\n* `0` - **Not** primary.","type":"integer"},"detected":{"example":"auto","enum":["auto","local","secondary","remote"],"description":"The mail exchanger type.\n* `auto`\n* `local`\n* `secondary`\n* `remote`","type":"string"},"local":{"type":"integer","description":"Whether the mail exchanger is a local exchanger.\n* `1` - Local.\n* `0` - **Not** local.","example":"0","enum":["0","1"]}},"type":"object","description":"An object of the mail exchanger's data."},"results":{"type":"string","description":"A message of success, or an error message.\n* A message of success that begins with `Added entry:`.\n* An error message.","example":"Replacing existing entry on line matched old entry and old priority: 51:\\nBind reloading on example using rndc zone: [example.com]"}},"type":"object"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function creates a Mail Exchanger (MX) record. For more information about MX record settings, read our [Email Routing Configuration](https://go.cpanel.net/whmdocsEmailRoutingConfiguration) documentation.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"change_mx","parameters":[{"schema":{"type":"string","format":"domain","example":"example.com"},"description":"The mail exchanger's domain.","required":"true","in":"query","name":"domain"},{"schema":{"format":"domain","example":"mail.example.com","type":"string"},"description":"The mail exchanger's name.","required":"true","name":"exchanger","in":"query"},{"schema":{"example":"mail.example.com","format":"domain","type":"string"},"description":"The mail exchanger's current name.","required":"true","in":"query","name":"oldexchanger"},{"description":"The mail exchanger's new [priority value](https://go.cpanel.net/whmdocsEditMXEntry).\n\n**Note:**\n\n  Common practice sets a priority value divisible by five.","schema":{"minimum":"0","type":"integer","example":"15"},"in":"query","name":"priority","required":"true"},{"description":"The mail exchanger's current priority value. If multiple MX entries match the `oldexchanger` value, the system uses this parameter to find the correct entry.","schema":{"example":"5","minimum":"0","type":"integer"},"in":"query","name":"oldpriority","required":"false"},{"description":"Whether the mail exchanger accepts all mail for the domain.\n* `1` — The mail exchanger always accepts mail.\n* `0` — The mail exchanger does **not** always accept mail.","schema":{"default":"0","enum":["0","1"],"example":"1","type":"integer"},"name":"alwaysaccept","in":"query","required":"false"}],"x-cpanel-api-version":"UAPI","summary":"Update mail exchanger record","tags":["Email DNS Settings"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  change_mx \\\n  domain='example.com' \\\n  exchanger='mail.example.com' \\\n  oldexchanger='mail.example.com' \\\n  priority='15'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/change_mx?domain=example.com&exchanger=mail.example.com&oldexchanger=mail.example.com&priority=15","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_change_mx.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_change_mx.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/Email/,\n    q/change_mx/,\n    {\n        'domain' => 'example.com',\n        'exchanger' => 'mail.example.com',\n        'oldexchanger' => 'mail.example.com',\n        'priority' => '15',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_change_mx.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_change_mx.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    'Email',\n    'change_mx',\n    array (\n        'domain' => 'example.com',\n        'exchanger' => 'mail.example.com',\n        'oldexchanger' => 'mail.example.com',\n        'priority' => '15',\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"}},"count_forwarders":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Email/count_forwarders":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  count_forwarders\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/count_forwarders","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_count_forwarders.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_count_forwarders.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/Email/,\n    q/count_forwarders/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_count_forwarders.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_count_forwarders.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    'Email',\n    'count_forwarders'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Email Forwarding"],"summary":"Return cPanel account's mail forwarder total","x-cpanel-api-version":"UAPI","parameters":[],"operationId":"count_forwarders","description":"This function returns the number of [forwarders](https://go.cpanel.net/Forwarders) for every email address on a cPanel account.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"count_forwarders","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"data":{"type":"integer","minimum":"0","example":"1","description":"The number of email forwarders.\n* `0`\n* A positive integer."},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}}}},"module":{"type":"string","description":"The name of the module called.","example":"Email"}}}}}}},"x-cpanel-available-version":"cPanel 82"}}},"x-tagGroups":[{"name":"Email","tags":["Email Forwarding"]}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Forwarding","description":"Email / Email Forwarding"}]},"trace_delivery":{"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/trace_delivery":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"},"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings\n describe non-critical failures or other problematic conditions\n noted while running a API.","items":{"type":"string"},"example":null},"metadata":{"properties":{}},"data":{"allOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBase"},{"$ref":"#/components/schemas/trace_deliveryType"}],"example":{"address":"username@example.com","destinations":[{"aliasfile":"/etc/valiases/example.com","destinations":[{"mailbox":"username@example.com","type":"local_delivery"}],"address":"username@example.com","type":"routed"}],"type":"routed"}},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"example":"trace_delivery","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 84","parameters":[{"name":"recipient","in":"query","required":"true","description":"The email address to which to trace a message delivery path.","schema":{"example":"username@example.com","type":"string"}}],"operationId":"trace_delivery","description":"This function traces the email delivery route to an email account.","summary":"Run email delivery route trace","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  trace_delivery \\\n  recipient='username@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/trace_delivery?recipient=username%40example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_trace_delivery.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_trace_delivery.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/Email/,\n    q/trace_delivery/,\n    {\n        'recipient' => 'username@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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_trace_delivery.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_trace_delivery.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    'Email',\n    'trace_delivery',\n    array (\n        'recipient' => 'username@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}"}],"tags":["Email","Email Accounts"]}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{"trace_deliveryResponseLocalDelivery":{"allOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBase"},{"properties":{"destinations":{"properties":{"mailbox":{"example":"user@example.com","description":"The mailbox where the system sent the email.","format":"email","type":"string"},"type":{"$ref":"#/components/schemas/trace_deliveryTypeDescription"}},"type":"object"}},"type":"object"}]},"trace_deliveryTypeDescription":{"description":"A type of trace node. The system returns this value to indicate the **end** of routing.\n* `bounce` - The system rejected the email's delivery.\n* `command` - The system will run a command when it receives an email.\n* `defer` - The system deferred the email.\n* `discard` - The system discarded the email.\n* `error` - The system encountered an error.\n* `local_delivery` - The system sent the email to a local mailbox.\n* `remote_delivery` - The system sent the email via Simple Mail Transfer Protocol (SMTP).\n* `routed` - The system routed the email elsewhere.\n\n**Note:**\n* The structure of the `destinations` return changes depending on the `type` return value.\n* The `routed` type can return any other type's data structure as part of the `destinations` return value.","example":"local_delivery","type":"string"},"trace_deliveryResponseDefer":{"allOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBase"},{"type":"object","properties":{"destinations":{"properties":{"message":{"type":"string","example":"The system deferred the message.","description":"A message that the system sends when it defers the email."},"type":{"$ref":"#/components/schemas/trace_deliveryTypeDescription"}},"type":"object"}}}]},"trace_deliveryResponseBase":{"properties":{"type":{"type":"string","description":"A type of trace node. The system returns this value to indicate the **end** of routing.\n* `bounce` - The system rejected the email's delivery.\n* `command` - The system will run a command when it receives an email.\n* `defer` - The system deferred the email.\n* `discard` - The system discarded the email.\n* `error` - The system encountered an error.\n* `local_delivery` - The system sent the email to a local mailbox.\n* `remote_delivery` - The system sent the email via Simple Mail Transfer Protocol (SMTP).\n* `routed` - The system routed the email elsewhere.\n\n**Note:**\n* The structure of the `destinations` return changes depending on the `type` return value.\n* The `routed` type can return any other type's data structure as part of the `destinations` return value.\n\nFor more information, see the return structure for each `type` return value below:","example":"local_delivery"},"address":{"type":"string","description":"The email address of an email message recipient.","format":"email","example":"username@example.com"}}},"trace_deliveryResponseError":{"allOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBase"},{"properties":{"destinations":{"type":"object","properties":{"message":{"type":"string","description":"An error message from the system.","example":"The mail server could not deliver mail to user@example2.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries."},"type":{"$ref":"#/components/schemas/trace_deliveryTypeDescription"},"result":{"description":"An error message.","example":"DNS lookup of example2.com (MX) gave HOST_NOT_FOUND","type":"string"}}}},"type":"object"}]},"trace_deliveryType":{"anyOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBounce"},{"$ref":"#/components/schemas/trace_deliveryResponseCommand"},{"$ref":"#/components/schemas/trace_deliveryResponseDefer"},{"$ref":"#/components/schemas/trace_deliveryResponseDiscard"},{"$ref":"#/components/schemas/trace_deliveryResponseError"},{"$ref":"#/components/schemas/trace_deliveryResponseLocalDelivery"},{"$ref":"#/components/schemas/trace_deliveryResponseRemoteDelivery"}],"discriminator":{"propertyName":"type","mapping":{"error":"#/components/schemas/trace_deliveryResponseError","remote_delivery":"#/components/schemas/trace_deliveryResponseRemoteDelivery","local_delivery":"#/components/schemas/trace_deliveryResponseLocalDelivery","discard":"#/components/schemas/trace_deliveryResponseDiscard","command":"#/components/schemas/trace_deliveryResponseCommand","defer":"#/components/schemas/trace_deliveryResponseDefer","bounce":"#/components/schemas/trace_deliveryResponseBounce"}}},"trace_deliveryResponseBounce":{"allOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBase"},{"properties":{"destinations":{"properties":{"message":{"description":"A message that the system sends when it rejects the delivery of an email.","example":"The system rejected the message.","type":"string"},"type":{"$ref":"#/components/schemas/trace_deliveryTypeDescription"}},"type":"object"}},"type":"object"}]},"trace_deliveryResponseRemoteDelivery":{"allOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBase"},{"properties":{"destinations":{"items":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/trace_deliveryTypeDescription"},"mx":{"items":{"example":"host.example.com [10.0.0.1] MX=20 dnssec=no","type":"string"},"description":"An array of strings containing [mail exchanger (MX) information](https://en.wikipedia.org/wiki/MX_record).\n\nEach string contains information for a single mail exchanger (MX), including:\n * The server's hostname.\n * The server's resolving IP address.\n * The MX record's priority. The lower the value, the higher its priority.\n * Whether DNSSEC is enabled for the hostname.","type":"array"}}},"type":"array"}}}]},"trace_deliveryResponseCommand":{"allOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBase"},{"type":"object","properties":{"destinations":{"type":"object","properties":{"command":{"description":"A command that the system runs when it receives the email.","example":"/usr/local/cpanel/bin/autorespond user@example.com /home/cpmailuser/.autorespond","type":"string"},"type":{"$ref":"#/components/schemas/trace_deliveryTypeDescription"}}}}}]},"trace_deliveryResponseDiscard":{"allOf":[{"$ref":"#/components/schemas/trace_deliveryResponseBase"},{"properties":{"destinations":{"properties":{"aliasfile":{"format":"path","description":"The file path on the system where Exim searched for the `address` return value's aliases.\n\n**Note:**\n\nThe function **only** returns this value if an alias exists for the `address` value.","example":"/etc/valiases/example.com","type":"string"},"type":{"$ref":"#/components/schemas/trace_deliveryTypeDescription"}},"type":"object"}},"type":"object"}]}}}},"list_filters_backups":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Filtering","description":"Email / Email Filtering"}],"paths":{"/Email/list_filters_backups":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"Email","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"items":{"properties":{"domain":{"type":"string","example":"example.com","format":"domain","description":"A domain with a domain-level filter."}},"type":"object"},"description":"An array of objects that contains information about domains with domain-level filters.","type":"array"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}},"type":"object"},"func":{"example":"list_filters_backups","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"description":"This function lists all of the cPanel account's domains that use domain-level filters.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_filters_backups","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return domains with domain-level email filters","tags":["Email","Email Filtering"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_filters_backups\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_filters_backups","label":"URL","lang":"HTTP"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_filters_backups.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_filters_backups.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/Email/,\n    q/list_filters_backups/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_filters_backups.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_filters_backups.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    'Email',\n    'list_filters_backups'\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-tagGroups":[{"name":"Email","tags":["Email Filtering"]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"has_delegated_mailman_lists":{"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Mailing Lists","description":"Email / Mailing Lists"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"x-tagGroups":[{"name":"Email","tags":["Mailing Lists"]}],"paths":{"/Email/has_delegated_mailman_lists":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"has_delegated_mailman_lists","description":"The name of the method called."},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"result":{"type":"object","properties":{"messages":{"type":"array","nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"}},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}},"data":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the email address has administrative privileges on one or more mailing lists on the cPanel account.\n* `1` — The email address has administrative privileges.\n* `0` — The email address does **not** have administrative privileges."},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}}}},"description":"This function checks an account's administrative privileges on mailing lists.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"has_delegated_mailman_lists","parameters":[{"schema":{"type":"string","example":"user@example.com","format":"email"},"description":"The email address.","required":"true","in":"query","name":"delegate"}],"summary":"Return email account's mailing list privileges","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  has_delegated_mailman_lists \\\n  delegate='user@example.com'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/has_delegated_mailman_lists?delegate=user%40example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_has_delegated_mailman_lists.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_has_delegated_mailman_lists.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/Email/,\n    q/has_delegated_mailman_lists/,\n    {\n        'delegate' => 'user@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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_has_delegated_mailman_lists.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_has_delegated_mailman_lists.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    'Email',\n    'has_delegated_mailman_lists',\n    array (\n        'delegate' => 'user@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}"}],"tags":["Email","Mailing Lists"]}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"stats_db_status":{"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Server Information","name":"Email Server Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/stats_db_status":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return eximstats SQLite database status","tags":["Email","Email Server Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  stats_db_status\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/stats_db_status"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_stats_db_status.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_stats_db_status.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/Email/,\n    q/stats_db_status/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_stats_db_status.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_stats_db_status.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    'Email',\n    'stats_db_status'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 64","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"warnings":{"type":"array","nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"metadata":{"properties":{}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"description":"The disk space that the email account uses.\n* `active` - The database is available and up-to-date.\n* `importing` - The database is available, but a data import is currently in progress.\n* `upcp` - The database is unavailable because cPanel & WHM is updating.\n\n**Note:**\n\nIf the `eximstats` database is running a cPanel & WHM update, but the database is available, this function will return `active`, **not** `upcp`.","enum":["active","importing","upcp"],"example":"active","type":"string"}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"stats_db_status","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function returns the status of the eximstats SQLite Database.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"stats_db_status","parameters":[]}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"reorder_filters":{"paths":{"/Email/reorder_filters":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  reorder_filters \\\n  mailbox='user@example.com' \\\n  filter*='coffee'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/reorder_filters?mailbox=user%40example.com&filter%2a=coffee","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_reorder_filters.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_reorder_filters.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/Email/,\n    q/reorder_filters/,\n    {\n        'mailbox' => 'user@example.com',\n        'filter*' => 'coffee',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_reorder_filters.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_reorder_filters.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    'Email',\n    'reorder_filters',\n    array (\n        'mailbox' => 'user@example.com',\n        'filter*' => 'coffee',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Filtering"],"summary":"Update email address's email filter order","x-cpanel-api-version":"UAPI","parameters":[{"schema":{"type":"string","example":"user@example.com"},"description":"The email address.","required":"true","name":"mailbox","in":"query"},{"in":"query","name":"filter*","required":"true","description":"A mail filter name.\n\nFor each mail filter to reorder, supply a `filter*` parameter, where `*` is a number that represents the filter's order.\n\nFor example, to set `coffee` as the first email filter and `cheesecloth` as the second, set `coffee` as the `filter1` parameter's value, and `cheesecloth` as the value for the `filter2` parameter.","schema":{"type":"string","example":"coffee"}}],"description":"This function modifies the filter order for an email address. For more information about Exim filters, read [Exim's documentation](http://www.exim.org/exim-html-3.30/doc/html/filter.html).\n\n**Important:**\n\nWhen you disable the [_Receive Mail_ role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"reorder_filters","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"reorder_filters","description":"The name of the method called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"data":{"type":"object","enum":[null],"nullable":"true"},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"}}},"module":{"type":"string","description":"The name of the module called.","example":"Email"}}}}}}},"x-cpanel-available-version":"cPanel 11.42"}}},"x-tagGroups":[{"name":"Email","tags":["Email Filtering"]}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Filtering","description":"Email / Email Filtering"}],"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"dispatch_client_settings":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/Email/dispatch_client_settings":{"get":{"tags":["Email","Email Accounts"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  dispatch_client_settings \\\n  to='user@example.com' \\\n  account='username'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/dispatch_client_settings?to=user%40example.com&account=username"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_dispatch_client_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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_dispatch_client_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/Email/,\n    q/dispatch_client_settings/,\n    {\n        'to' => 'user@example.com',\n        'account' => 'username',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_dispatch_client_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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_dispatch_client_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    'Email',\n    'dispatch_client_settings',\n    array (\n        'to' => 'user@example.com',\n        'account' => 'username',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Send email client settings to an email address","parameters":[{"name":"to","in":"query","required":"true","description":"The email address to send client settings.","schema":{"example":"user@example.com","format":"email","type":"string"}},{"schema":{"oneOf":[{"format":"username","example":"username","type":"string"},{"format":"email","example":"username@example.com","type":"string"}]},"example":"username","description":"The email account username or address for which to send client settings.","required":"true","name":"account","in":"query"}],"operationId":"dispatch_client_settings","description":"This function sends an email account's client settings to an email address.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"example":"dispatch_client_settings","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"metadata":{"properties":{}},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}}}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 62"}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Accounts","name":"Email Accounts"}]},"get_mailman_delegates":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"openapi":"3.0.2","x-tagGroups":[{"name":"Email","tags":["Mailing Lists"]}],"paths":{"/Email/get_mailman_delegates":{"get":{"operationId":"get_mailman_delegates","description":"This function lists a mailing list's administrators.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","parameters":[{"name":"list","in":"query","required":"true","description":"The name of a Mailman mailing list on the cPanel account.","schema":{"example":"mylist","type":"string"}}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_mailman_delegates"},"module":{"type":"string","example":"Email","description":"The name of the module called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"data":{"properties":{"delegates":{"items":{"type":"string","format":"email","example":"secondadmin@example.com"},"description":"An array of the mailing list's administrators.","type":"array"},"metadata":{"type":"object","properties":{"transformed":{}}}},"type":"object"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"metadata":{"properties":{}}},"type":"object"}}}}},"description":"HTTP Request was successful."}},"tags":["Email","Mailing Lists"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_mailman_delegates \\\n  list='mylist'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_mailman_delegates?list=mylist"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_mailman_delegates.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_mailman_delegates.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/Email/,\n    q/get_mailman_delegates/,\n    {\n        'list' => 'mylist',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_mailman_delegates.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_mailman_delegates.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    'Email',\n    'get_mailman_delegates',\n    array (\n        'list' => 'mylist',\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return mailing list administrators"}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Mailing Lists","name":"Mailing Lists"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}}}]},"list_default_address":{"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"paths":{"/Email/list_default_address":{"get":{"tags":["Email","Email Accounts"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_default_address \\\n  user='user'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_default_address?user=user"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_default_address.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_default_address.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/Email/,\n    q/list_default_address/,\n    {\n        'user' => 'user',\n    }\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_default_address.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_default_address.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    'Email',\n    'list_default_address',\n    array (\n        'user' => 'user',\n    )\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","summary":"Return domain's default email address","parameters":[{"schema":{"format":"domain","example":"example.com","type":"string"},"description":"The domain. If you do not specify a value, the function lists default addresses for all of the cPanel account's domains.","required":"false","name":"domain","in":"query"},{"required":"true","in":"query","name":"user","schema":{"type":"string","example":"user","format":"username"},"description":"The user whose default addresses to list."}],"description":"This function retrieves a domain's default address.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_default_address","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"description":"The name of the module called.","example":"Email","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"data":{"type":"array","description":"An object of data for a domain.","items":{"properties":{"domain":{"format":"domain","description":"The domain name.","example":"example.com","type":"string"},"defaultaddress":{"type":"string","description":"The domain's default address.\n* An email account username - The system forwards unroutable mail to this address.\n* `:fail:` - The system bounces unroutable mail back to the sender, and sends a failure message.\n* `:blackhole:` - The system deletes unroutable mail without a failure message.\n* The path to an application - The system pipes unroutable mail to this application.","example":"user"}},"type":"object"}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed."},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}}}},"func":{"type":"string","example":"list_default_address","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"delete_pop":{"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"paths":{"/Email/delete_pop":{"get":{"parameters":[{"schema":{"anyOf":[{"example":"user@domain.com","format":"email","type":"string"},{"type":"string","example":"user"}]},"example":"user@domain.com","description":"The email account username or address.\n* A valid email account username. For example, `user` if the email address is `user@example.com`.\n* A valid email address.","required":"true","in":"query","name":"email"},{"description":"Whether to remove the mail account's home mail directory. If you do not specify a value, the function removes the mail account's home directory.\n* `passwd` — Preserve the mail account's home directory.\n* Any other value — Remove the mail account's home directory.","schema":{"type":"string","example":"passwd"},"in":"query","name":"flags","required":"false"},{"schema":{"type":"string","example":"example.com","format":"domain","default":"The cPanel account's main domain."},"description":"The email account's domain. For example, `example.com` if the email address is `user@example.com`.","required":"false","in":"query","name":"domain"},{"in":"query","name":"skip_quota","required":"false","description":"Whether to modify the mail account's quota file.\n* `1` — Do **not** modify.\n* `0` — Modify.","schema":{"type":"integer","default":"0","enum":["0","1"],"example":"0"}}],"operationId":"delete_pop","description":"This function deletes an email address.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"delete_pop"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{}}}}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42","tags":["Email","Email Accounts"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  delete_pop \\\n  email='user@domain.com'\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/delete_pop?email=user%40domain.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_delete_pop.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_delete_pop.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/Email/,\n    q/delete_pop/,\n    {\n        'email' => 'user@domain.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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_delete_pop.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_delete_pop.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    'Email',\n    'delete_pop',\n    array (\n        'email' => 'user@domain.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}"}],"x-cpanel-api-version":"UAPI","summary":"Delete email address"}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}]},"suspend_outgoing":{"x-tagGroups":[{"name":"Email","tags":["Email Suspensions"]}],"paths":{"/Email/suspend_outgoing":{"get":{"operationId":"suspend_outgoing","description":"This function rejects outgoing mail for a suspended email account. This function does **not** disable a user's login credentials or access permissions to their email account.\n\n**Notes:**\n\n* To suspend a user's login credentials and prevent authenticated connections to the email account, use the UAPI `Email::suspend_login` function.\n* To allow an email account to send mail, use the UAPI `Email::unsuspend_outgoing` function.\n* To hold outgoing mail in Exim's queue, use the UAPI `Email::hold_outgoing` function.\n\n**Important:**\n\nWhen you disable the [Send Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"name":"email","in":"query","required":"true","description":"The email account's username.","schema":{"type":"string","example":"username@example.com","format":"email"}}],"x-cpanel-available-version":"cPanel 70","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"suspend_outgoing","description":"The name of the method called."},"module":{"type":"string","example":"Email","description":"The name of the module called."},"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"type":"array","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"nullable":"true"},"metadata":{"properties":{}},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"description":"Whether the function succeeded.\n* `1` — The function succeeded.\n* `0` — The function failed.","enum":["0","1"],"example":"1","type":"integer"}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["Email","Email Suspensions"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  suspend_outgoing \\\n  email='username@example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/suspend_outgoing?email=username%40example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_suspend_outgoing.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_suspend_outgoing.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/Email/,\n    q/suspend_outgoing/,\n    {\n        'email' => 'username@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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_suspend_outgoing.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_suspend_outgoing.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    'Email',\n    'suspend_outgoing',\n    array (\n        'email' => 'username@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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Suspend email account outgoing mail"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Suspensions","description":"Email / Email Suspensions"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"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/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"list_lists":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Mailing Lists","description":"Email / Mailing Lists"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"x-tagGroups":[{"tags":["Mailing Lists"],"name":"Email"}],"paths":{"/Email/list_lists":{"get":{"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_lists\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_lists"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_lists.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_lists.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/Email/,\n    q/list_lists/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_lists.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_lists.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    'Email',\n    'list_lists'\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}"}],"tags":["Email","Mailing Lists"],"summary":"Return cPanel account's mailing lists","x-cpanel-api-version":"UAPI","operationId":"list_lists","description":"This function lists the account's Mailman mailing lists.","parameters":[{"schema":{"type":"string","example":"user"},"description":"A [Perl Compatible Regular Expression (PCRE)](https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) that filters the results.","required":"false","in":"query","name":"regex"},{"description":"The domain to query. If you do **not** use this parameter, the function lists mailing lists for all of the cPanel account's domains.","schema":{"type":"string","format":"domain","example":"example.com"},"in":"query","name":"domain","required":"false"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"data":{"type":"array","items":{"properties":{"subscribe_policy":{"description":"The level of control that the mailing list administrator has over new subscribers.\n* `1` - Anyone can subscribe. The system sends a confirmation email.\n* `2` - The administrator **must** approve subscriptions. The system does **not** send a confirmation email.\n* `3` - The administrator **must** approve subscriptions. The system sends a confirmation email.","example":"1","enum":["1","2","3"],"type":"integer"},"archive_private":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the mailing list archive is `private`.\n* `1` - The mailing list archive is `private`.\n* `0` - The mailing list archive is `public`."},"desthost":{"oneOf":[{"type":"string","format":"domain"},{"type":"string","format":"ipv4"}],"description":"The IP address or domain name that handles mail for the mailing list's domain.\n* A valid hostname.\n* An IPv4 address.\n\n**Note:**\n\n  If the function **cannot** resolve the IP address to a hostname, it will return the IP address.","example":"172.16.254.1"},"humandiskused":{"description":"The disk space that the mailing list uses, in human-readable format.","example":"19.9\\u00a0KB","type":"string"},"advertised":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the Mailman directory page displays the list.\n* `1` - The Mailman directory page displays the list.\n* `0` - The Mailman directory page does not display the list."},"diskused":{"minimum":"0","type":"integer","description":"The disk space that the mailing list currently uses, measured in megabytes (MB).","example":"20379"},"listid":{"description":"The mailing list's name and domain. The mailing list name, an underscore (_), and the domain.","example":"list_example.com","type":"string"},"listadmin":{"type":"string","example":"admin@example.com,admin2@example.com","description":"The mailing list's administrators' email addresses. A comma-separated list of email addresses."},"accesstype":{"type":"string","example":"public","enum":["private","public"],"description":"The level of access that users have to the mailing list.\n* `private` - The list has **all** of the following settings:\n  * The list has private archives.\n  * The administrator **must** approve subscriptions.\n  * The Mailman directory page does **not** display the list.\n* `public` - The list has **any** of the following settings:\n  * The list has public archives.\n  * Anyone can subscribe.\n  * The Mailman directory page displays the list."},"list":{"type":"string","example":"list@example.com","description":"The mailing list name and domain.","format":"email"}},"type":"object"}},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}}},"type":"object"},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"list_lists","type":"string"}}}}}}}}}}},"list_pops":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"paths":{"/Email/list_pops":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Email","type":"string"},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"items":{"type":"object","properties":{"suspended_login":{"type":"integer","example":"0","enum":["0","1"],"description":"Whether logins for the email account are suspended.\n* `1` - Suspended.\n* `0` - Not suspended."},"email":{"oneOf":[{"type":"string","format":"email"},{"type":"string","format":"username"}],"example":"user@example.com","description":"An email address.\n* A valid email address on the cPanel account.\n* The cPanel account username, for the main account."},"suspended_incoming":{"example":"0","enum":["0","1"],"description":"Whether incoming email for the email account is suspended.\n* `1` - Suspended.\n* `0` - Not suspended.","type":"integer"},"login":{"oneOf":[{"type":"string","format":"email"},{"type":"string","enum":["Main Account"]}],"example":"user@example.com","description":"The email account login.\n* A valid email address on the cPanel account.\n* `Main Account`, for the main account."}}},"description":"An object of data for an email address on the cPanel account.","type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"func":{"type":"string","example":"list_pops","description":"The name of the method called."}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"description":"A [Perl Compatible Regular Expression (PCRE)](https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) that filters the results.","schema":{"example":"user","type":"string"},"name":"regex","in":"query","required":"false"},{"description":"Whether to skip the email database's validation check.\n* `1` — Skip the validation check.\n* `0` — Run the validation check.","schema":{"type":"integer","enum":["0","1"],"example":"1","default":"0"},"name":"no_validate","in":"query","required":"false"},{"schema":{"default":"0","enum":["0","1"],"example":"0","type":"integer"},"description":"Whether to exclude the cPanel account's main account from the results.\n* `1` — Exclude the main account.\n* `0` — Include the main account.","required":"false","name":"skip_main","in":"query"}],"description":"This function lists the cPanel account's email accounts.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_pops","summary":"Return email accounts","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_pops\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_pops","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_pops.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_pops.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/Email/,\n    q/list_pops/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_pops.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_pops.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    'Email',\n    'list_pops'\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}"}],"tags":["Email","Email Accounts"]}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}]},"browse_mailbox":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"openapi":"3.0.2","x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/browse_mailbox":{"get":{"parameters":[{"description":"An email address, to limit the function's results.","schema":{"type":"string","example":"user@example.com","format":"email"},"name":"account","in":"query","required":"false"},{"description":"A mail directory name, to limit results to specific directories.\n\n**Note:**\n\n  If you pass the `default` or `mail` values, the function lists information for all mail directories.","schema":{"type":"string","example":"maildir"},"in":"query","name":"dir","required":"false"},{"schema":{"enum":["0","1"],"example":"0","default":"0","type":"integer"},"description":"Whether to include hidden files and directories.\n* `1` — Include hidden items.\n* `0` — Do **not** include hidden items.","required":"false","in":"query","name":"showdotfiles"}],"operationId":"browse_mailbox","description":"This function lists the mail directory's subdirectories (boxes) and files.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.\n\n**Notes:**\n\n  If you do not use any input parameters, the function returns a list of items in the cPanel account's main mail directory.","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"fullpath":{"type":"string","example":"/home/example/mail/archive","description":"The item's absolute path.","format":"path"},"type":{"example":"dir","enum":["dir","file"],"description":"The item type.\n* `dir` - The item is a directory.\n* `file` - The item is a file.","type":"string"},"mtime":{"description":"The item's modification time. A time, in [Unix time](https://en.wikipedia.org/wiki/Unix_time) format.","format":"unix_timestamp","example":"1413398866","type":"integer"},"relpath":{"type":"string","example":"/archive","format":"path","description":"The item's relative path."},"ismailbox":{"description":"Whether the item is a mailbox.\n* `1` - Mailbox.\n* `0` - **Not** a mailbox.","example":"0","enum":["0","1"],"type":"integer"},"path":{"type":"string","example":"/home/example/mail","description":"The item's directory's path.","format":"path"},"file":{"type":"string","example":"archive","description":"The item's base name."},"depth":{"minimum":"0","type":"integer","example":"2","description":"The directory depth of the item's path."},"isleaf":{"type":"integer","description":"Whether the item is a file or a directory.\n* `1` - File.\n* `0` - Directory.","enum":["0","1"],"example":"0"}}}},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","enum":["1"],"example":"1"}}},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"description":"The name of the method called.","example":"browse_mailbox","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","tags":["Email","Email Accounts"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  browse_mailbox\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/browse_mailbox"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_browse_mailbox.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_browse_mailbox.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/Email/,\n    q/browse_mailbox/\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_browse_mailbox.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_browse_mailbox.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    'Email',\n    'browse_mailbox'\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","summary":"Return mail directory's subdirectories and files"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"list_forwarders":{"paths":{"/Email/list_forwarders":{"get":{"operationId":"list_forwarders","description":"This function lists a domain's forwarders.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"required":"true","name":"domain","in":"query","schema":{"format":"domain","example":"example.com","type":"string"},"description":"The domain."},{"required":"false","in":"query","name":"regex","schema":{"type":"string","example":"user"},"description":"A [Perl Compatible Regular Expression (PCRE)](https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) that filters the results. If you do **not** use this parameter, the function returns results for all of the account's filters."}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"type":"array","items":{"type":"object","properties":{"dest":{"type":"string","description":"The forwarded address.","format":"email","example":"forwarded@example.com"},"html_forward":{"example":"user@example.com","description":"The forwarded mail's destination in an HTML-compatible format.","format":"email","type":"string"},"uri_forward":{"type":"string","example":"user%40example.com","description":"The forwarded mail's destination in a URI-encoded format."},"html_dest":{"description":"The forwarded address in an HTML-compatible format.","format":"email","example":"forwarded@example.com","type":"string"},"forward":{"description":"The forwarded mail's destination.","format":"email","example":"user@example.com","type":"string"},"uri_dest":{"description":"The forwarded address in a URI-encoded format.","example":"forwarded%40example.com","type":"string"}}}},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"example":"list_forwarders","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_forwarders \\\n  domain='example.com'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_forwarders?domain=example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_forwarders.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_forwarders.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/Email/,\n    q/list_forwarders/,\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    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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_forwarders.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_forwarders.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    'Email',\n    'list_forwarders',\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    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}"}],"tags":["Email","Email Forwarding"],"summary":"Return domain's forwarders","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Email Forwarding"],"name":"Email"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Forwarding","name":"Email Forwarding"}],"info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}}},"generate_mailman_otp":{"paths":{"/Email/generate_mailman_otp":{"get":{"operationId":"generate_mailman_otp","description":"This function generates a one-time password (OTP) for a mailing list.\n\n**Note:**\n\nThe generated password expires after one use.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"schema":{"example":"mylist","type":"string"},"description":"The mailing list.","required":"true","name":"list","in":"query"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"generate_mailman_otp","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"type":"object","properties":{"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"data":{"description":"The new one-time password.","example":"LfFYLPRT_UoS4EDi9lGKuOFK8FaWQsozzPYn8WjM3","type":"string"},"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"warnings":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API."},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"}}}},"type":"object"}}}}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  generate_mailman_otp \\\n  list='mylist'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/generate_mailman_otp?list=mylist","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_generate_mailman_otp.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_generate_mailman_otp.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/Email/,\n    q/generate_mailman_otp/,\n    {\n        'list' => 'mylist',\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_generate_mailman_otp.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_generate_mailman_otp.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    'Email',\n    'generate_mailman_otp',\n    array (\n        'list' => 'mylist',\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}"}],"tags":["Email","Mailing Lists"],"summary":"Create one-time password for a mailing list","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Mailing Lists"],"name":"Email"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Mailing Lists","name":"Mailing Lists"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"get_default_email_quota_mib":{"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","paths":{"/Email/get_default_email_quota_mib":{"get":{"x-cpanel-available-version":"cPanel 11.48","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Email"},"result":{"properties":{"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"metadata":{"properties":{}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"data":{"minimum":"0","type":"integer","maximum":"4294967296","description":"The default email quota in [mebibytes](https://en.wikipedia.org/wiki/Mebibyte) (MiB).\n\nThe value will either be:\n* The system's default quota value (32 gigabytes).\n* The account's quota value, if it is less than the system's default value.","example":"32768"}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"description":"The name of the method called.","example":"get_default_email_quota_mib","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"operationId":"get_default_email_quota_mib","description":"This function retrieves the account's default email quota size in [mebibytes](https://en.wikipedia.org/wiki/Mebibyte) (MiB).\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return email account's default email quota in MiB","tags":["Email","Email Accounts"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_default_email_quota_mib\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_default_email_quota_mib","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_default_email_quota_mib.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_default_email_quota_mib.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/Email/,\n    q/get_default_email_quota_mib/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_default_email_quota_mib.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_default_email_quota_mib.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    'Email',\n    'get_default_email_quota_mib'\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Accounts","name":"Email Accounts"}]},"add_mx":{"paths":{"/Email/add_mx":{"get":{"operationId":"add_mx","description":"This function creates a Mail Exchanger (MX) record. For more information about MX record settings, read our [Email Routing Configuration](https://go.cpanel.net/whmdocsEmailRoutingConfiguration) documentation.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function","parameters":[{"required":"true","name":"domain","in":"query","schema":{"type":"string","example":"example.com","format":"domain"},"description":"The new mail exchanger's domain."},{"description":"The new mail exchanger's name.","schema":{"type":"string","format":"domain","example":"mail.example.com"},"in":"query","name":"exchanger","required":"true"},{"description":"The new mail exchanger's [priority value](https://go.cpanel.net/whmdocsEditMXEntry).\n\n**Note:**\n\n  It is common practice to set a priority value that is divisible by five.","schema":{"type":"integer","minimum":"0","example":"5"},"in":"query","name":"priority","required":"true"},{"required":"false","name":"alwaysaccept","in":"query","schema":{"type":"integer","enum":["0","1"],"example":"1","default":"0"},"description":"Whether the mail exchanger accepts all mail for the domain.\n* `1` — The mail exchanger always accepts mail.\n* `0` — The mail exchanger does **not** always accept mail."}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"add_mx","description":"The name of the method called."},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"object","properties":{"results":{"type":"string","description":"A message of success, or an error message.\n* A message of success that begins with `Added entry:`.\n* An error message.","example":"Added entry:\\nBind reloading on example using rndc zone: [example.com]\\n"},"statusmsg":{"type":"string","description":"A message of success, or an error message.\n* A message of success that begins with `Added entry:`.\n* An error message.","example":"Added entry:\\nBind reloading on example using rndc zone: [example.com]\\n"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"Whether the function succeeded.\n* `1` - Success.\n* `0` - Failure."},"checkmx":{"description":"An object of the mail exchanger's data.","type":"object","properties":{"warnings":{"type":"array","description":"Warning messages, if any exist.","items":{"example":"Auto Detect of MX configuration not possible due to non-resolving MX entries. Defaulting to last known setting: local.","type":"string"}},"remote":{"description":"Whether the mail exchanger is a remote exchanger.\n* `1` - Remote.\n* `0` - **Not** remote.","enum":["0","1"],"example":"0","type":"integer"},"changed":{"type":"integer","description":"Whether a change occurred during the function.\n* `1` - Change occurred.\n* `0` - **No** change.","example":"1","enum":["0","1"]},"mxcheck":{"type":"string","enum":["auto","local","secondary","remote"],"example":"auto","description":"The mail exchanger type.\n* `auto`\n* `local`\n* `secondary`\n* `remote`"},"issecondary":{"type":"integer","description":"Whether the mail exchanger is a secondary exchanger.\n* `1` - Secondary.\n* `0` - **Not** secondary.","example":"0","enum":["0","1"]},"local":{"example":"0","enum":["0","1"],"description":"Whether the mail exchanger is a local exchanger.\n* `1` - Local.\n* `0` - **Not** local.","type":"integer"},"secondary":{"example":"0","enum":["0","1"],"description":"Whether the mail exchanger is a secondary exchanger.\n* `1` - Secondary.\n* `0` - **Not** secondary.","type":"integer"},"isprimary":{"type":"integer","description":"Whether the mail exchanger is the primary mail exchanger.\n* `1` - Primary.\n* `0` - **Not** primary.","example":"0","enum":["0","1"]},"detected":{"type":"string","description":"The mail exchanger type.\n* `auto`\n* `local`\n* `secondary`\n* `remote`","enum":["auto","local","secondary","remote"],"example":"auto"}}}}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"}}},"module":{"type":"string","example":"Email","description":"The name of the module called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"tags":["Email DNS Settings"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  add_mx \\\n  domain='example.com' \\\n  exchanger='mail.example.com' \\\n  priority='5'\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/add_mx?domain=example.com&exchanger=mail.example.com&priority=5"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_add_mx.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_add_mx.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/Email/,\n    q/add_mx/,\n    {\n        'domain' => 'example.com',\n        'exchanger' => 'mail.example.com',\n        'priority' => '5',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_add_mx.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_add_mx.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    'Email',\n    'add_mx',\n    array (\n        'domain' => 'example.com',\n        'exchanger' => 'mail.example.com',\n        'priority' => '5',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Create mail exchanger record"}}},"x-tagGroups":[{"tags":["Email DNS Settings"],"name":"DNS"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"enable_filter":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Filtering","name":"Email Filtering"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}}}],"x-tagGroups":[{"tags":["Email Filtering"],"name":"Email"}],"paths":{"/Email/enable_filter":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}},"status":{"type":"integer","description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true","type":"array"},"data":{"properties":{"filtername":{"type":"string","description":"The filter's name.","example":"coffee"},"updated":{"type":"integer","enum":["0","1"],"example":"1","description":"Whether the function updated the filter.\n* `1` - Updated.\n* `0` - Did **not** update."}},"type":"object"}},"type":"object"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"type":"string","description":"The name of the method called.","example":"enable_filter"}},"type":"object"}}}}},"description":"This function enables an email filter.\n\n**Important:**\n\n  When you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"enable_filter","parameters":[{"schema":{"type":"string","format":"email","example":"username@example.com"},"description":"The email address that owns the filter.","required":"true","in":"query","name":"account"},{"description":"The filter's name.","schema":{"type":"string","example":"coffee"},"name":"filtername","in":"query","required":"true"}],"summary":"Enable email filter for email account","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  enable_filter \\\n  account='username@example.com' \\\n  filtername='coffee'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/enable_filter?account=username%40example.com&filtername=coffee"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_enable_filter.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_enable_filter.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/Email/,\n    q/enable_filter/,\n    {\n        'account' => 'username@example.com',\n        'filtername' => 'coffee',\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_enable_filter.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_enable_filter.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    'Email',\n    'enable_filter',\n    array (\n        'account' => 'username@example.com',\n        'filtername' => 'coffee',\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}"}],"tags":["Email","Email Filtering"]}}}},"get_pop_quota":{"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/get_pop_quota":{"get":{"tags":["Email","Email Accounts"],"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_pop_quota \\\n  email='user'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_pop_quota?email=user"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_pop_quota.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_pop_quota.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/Email/,\n    q/get_pop_quota/,\n    {\n        'email' => 'user',\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_pop_quota.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_pop_quota.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    'Email',\n    'get_pop_quota',\n    array (\n        'email' => 'user',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Return email account's quota","parameters":[{"in":"query","name":"email","required":"true","description":"The email account username.  For example, user if the email address is user@example.com.","schema":{"example":"user","type":"string"}},{"description":"The email account's domain. This parameter defaults to the cPanel account's main domain.","schema":{"type":"string","example":"example.com","format":"domain"},"in":"query","name":"domain","required":"false"},{"in":"query","name":"as_bytes","required":"false","description":"Whether to return the quota as bytes.\n\n* `1` — Return the quota as bytes.\n* `0` — Return the quota as megabytes (MB).","schema":{"type":"integer","default":"0","example":"1","enum":["0","1"]}}],"description":"This function retrieves an email account's quota.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"get_pop_quota","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"get_pop_quota"},"module":{"type":"string","example":"Email","description":"The name of the module called."},"result":{"type":"object","properties":{"metadata":{"properties":{}},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success\n* `0` - Failed: Check the `errors` field for more details.","type":"integer"},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"type":"integer","example":"262144000","description":"The email account's quota.\n\n**Note:**\n\nThis value's unit of measure depends on the `as_bytes` input parameter's value."},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.","nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"count_lists":{"servers":[{"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."}},"description":"A server running cPanel."}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Mailing Lists","name":"Mailing Lists"}],"paths":{"/Email/count_lists":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  count_lists\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/count_lists"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_count_lists.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_count_lists.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/Email/,\n    q/count_lists/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_count_lists.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_count_lists.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    'Email',\n    'count_lists'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Mailing Lists"],"summary":"Return cPanel account's mailing list total","x-cpanel-api-version":"UAPI","description":"This function returns the number of [mailing lists](https://go.cpanel.net/MailingLists) for every email address on a cPanel account.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","operationId":"count_lists","parameters":[],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"count_lists","description":"The name of the method called."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"result":{"properties":{"metadata":{"properties":{"transformed":{"enum":["1"],"example":"1","description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"example":"1","description":"The number of mailing lists.\n* `0`\n* A positive integer.","type":"integer","minimum":"0"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"}},"type":"object"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}}}}}}},"x-tagGroups":[{"name":"Email","tags":["Mailing Lists"]}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"get_main_account_disk_usage":{"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"paths":{"/Email/get_main_account_disk_usage":{"get":{"tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_main_account_disk_usage\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_main_account_disk_usage"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_main_account_disk_usage.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_main_account_disk_usage.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/Email/,\n    q/get_main_account_disk_usage/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_main_account_disk_usage.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_main_account_disk_usage.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    'Email',\n    'get_main_account_disk_usage'\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Return primary email account's disk usage","operationId":"get_main_account_disk_usage","description":"This function returns the disk space that the main account uses.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"data":{"type":"string","example":"3076 bytes","description":"The current amount of disk space that the main email account uses."}}},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"type":"string","example":"get_main_account_disk_usage","description":"The name of the method called."}}}}},"description":"HTTP Request was successful."}}}}},"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"openapi":"3.0.2","info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"trace_filter":{"paths":{"/Email/trace_filter":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","description":"The name of the module called.","example":"Email"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"data":{"properties":{"trace":{"type":"string","example":"Warning: no message headers read\\nReturn-path copied from sender\\nSender = user@example.com\\nRecipient = user@example.com\\nTesting Exim filter file &quot;/etc/vfilters/example.com&quot;\\n\\nFiltering did not set up a significant delivery.\\n<b>Normal delivery will occur.\\n</b>","description":"A series of messages that describe the trace results.\n\n**Note:**\n\nThis output may contain HTML."}},"type":"object"},"errors":{"description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","example":"1","enum":["0","1"],"type":"integer"},"metadata":{"properties":{}},"messages":{"nullable":"true","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"type":"array"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}}},"type":"object"},"func":{"description":"The name of the method called.","example":"trace_filter","type":"string"}},"type":"object"}}}}},"description":"This function tests mail filters. The function **only** tests filters for the cPanel account's main domain, and only tests against the message's body. For more information about Exim filters, read [Exim's documentation](http://www.exim.org/exim-html-3.30/doc/html/filter.html).\n\n**Note:**\n\nIf the domain or account does not contain a filter file, this function will fail.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"trace_filter","parameters":[{"required":"false","in":"query","name":"account","schema":{"type":"string","format":"email","example":"user@example.com"},"description":"The email address, to test legacy cPanel filters in the filters directory. If you do not use this parameter, the function tests the main domain's filters in the `/etc/vfilters` directory."},{"schema":{"type":"string","example":"Test"},"description":"The string to test. The function uses this string as the body of an email message, to check whether filters would match the string.","required":"true","in":"query","name":"msg"}],"summary":"Run test for main domain email filters","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  trace_filter \\\n  msg='Test'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/trace_filter?msg=Test","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_trace_filter.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_trace_filter.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/Email/,\n    q/trace_filter/,\n    {\n        'msg' => 'Test',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_trace_filter.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_trace_filter.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    'Email',\n    'trace_filter',\n    array (\n        'msg' => 'Test',\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Filtering"]}}},"x-tagGroups":[{"name":"Email","tags":["Email Filtering"]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Filtering","name":"Email Filtering"}],"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"set_always_accept":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/set_always_accept":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"}},"data":{"properties":{"local":{"example":"0","enum":["0","1"],"description":"Whether the mail exchanger is a local exchanger.\n* `1` — Local.\n* `0` — **Not** local.","type":"integer"},"results":{"example":"Set Always Accept Status to: local","description":"A message of success or a reason for failure.\n* A message of success that includes the new type.\n* A string that describes an error.","type":"string"},"secondary":{"enum":["0","1"],"example":"0","description":"Whether the mail exchanger is a secondary exchanger.\n* `1` — Secondary.\n* `0` — **Not** secondary.","type":"integer"},"detected":{"type":"string","description":"The mail exchanger type.\n  * `auto` — Allow cPanel to determine the appropriate role.\n  * `local` — Always accept the domain's mail.\n  * `secondary` — Accept mail until a higher priority mail server is available.\n  * `remote` — Do **not** accept mail.","example":"auto"},"checkmx":{"type":"object","properties":{"mxcheck":{"enum":["auto","local","secondary","remote"],"example":"auto","description":"The mail exchanger type.\n  * `auto` — Allow cPanel to determine the appropriate role.\n  * `local` — Always accept the domain's mail.\n  * `secondary` — Accept mail until a higher priority mail server is available.\n  * `remote` — Do **not** accept mail.","type":"string"},"issecondary":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the mail exchanger is a secondary exchanger.\n* `1` — Secondary.\n* `0` — **Not** secondary."},"secondary":{"type":"integer","enum":["0","1"],"example":"0","description":"Whether the mail exchanger is a secondary exchanger.\n* `1` — Secondary.\n* `0` — **Not** secondary."},"isprimary":{"type":"integer","description":"Whether the mail exchanger is the primary mail exchanger.\n* `1` —  Primary.\n* `0` — **Not** primary.","enum":["0","1"],"example":"0"},"detected":{"type":"string","example":"auto","enum":["auto","local","secondary","remote"],"description":"The mail exchanger type.\n* `auto` — Allow cPanel to determine the appropriate role.\n* `local` — Always accept the domain's mail.\n* `secondary` — Accept mail until a higher priority mail server is available.\n* `remote` — Do **not** accept mail."},"local":{"type":"integer","description":"Whether the mail exchanger is a local exchanger.\n* `1` — Local.\n* `0` — **Not** local.","example":"0","enum":["0","1"]},"remote":{"enum":["0","1"],"example":"0","description":"Whether the mail exchanger is a remote exchanger.\n* `1` — Remote.\n* `0` — **Not** remote.","type":"integer"},"changed":{"description":"Whether a change occurred during the function.\n* `1` — Change occurred.\n* `0` — **No** change.","example":"1","enum":["0","1"],"type":"integer"},"warnings":{"description":"An array of warning messages, if any exist. One or more warning messages.","items":{"example":"Auto Detect of MX configuration not possible due to non-resolving MX entries. Defaulting to last known setting: local.","type":"string"},"type":"array"}},"description":"An object containing the mail exchanger's data."},"mxcheck":{"type":"string","description":"The mail exchanger type.\n  * `auto` — Allow cPanel to determine the appropriate role.\n  * `local` — Always accept the domain's mail.\n  * `secondary` — Accept mail until a higher priority mail server is available.\n  * `remote` — Do **not** accept mail.","example":"auto"},"remote":{"description":"Whether the mail exchanger is a remote exchanger.\n* `1` — Remote.\n* `0` — **Not** remote.","example":"0","enum":["0","1"],"type":"integer"},"status":{"type":"integer","description":"Whether the function succeeded.\n* `1` — Success.\n* `0` — Failure.","example":"1","enum":["0","1"]},"statusmsg":{"type":"string","description":"A message of success or a reason for failure.\n* A message of success that includes the new type.\n* A string that describes an error.","example":"Set Always Accept Status to: local"}},"type":"object"},"errors":{"type":"array","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"metadata":{"properties":{}}},"type":"object"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"set_always_accept"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"description":"The mail exchanger's domain.","schema":{"format":"domain","example":"example.com","type":"string"},"name":"domain","in":"query","required":"true"},{"description":"The mail exchanger type.\n* `auto` — Allow cPanel to determine the appropriate role.\n* `local` — Always accept the domain's mail.\n* `secondary` — Accept mail until a higher priority mail server is available.\n* `remote` — Do **not** accept mail.\n\n**Note:**\n\nThis parameter is redundant with the `alwaysaccept` parameter. Do **not** enter the `mxcheck` and `alwaysaccept`\nparameters at the same time. [Undefined behavior](https://en.wikipedia.org/wiki/Undefined_behavior) may occur if this\nhappens.","schema":{"default":"auto","example":"auto","enum":["auto","local","secondary","remote"],"type":"string"},"in":"query","name":"mxcheck","required":"false"},{"description":"The mail exchanger type.\n* `auto` — Allow cPanel to determine the appropriate role.\n* `local` — Always accept the domain's mail.\n* `secondary` — Accept mail until a higher priority mail server is available.\n* `remote` — Do **not** accept mail.\n\n**Note:**\n\nThis parameter is redundant with the `mxcheck` parameter. Do **not** enter the `mxcheck` and `alwaysaccept`\nparameters at the same time. [Undefined behavior](https://en.wikipedia.org/wiki/Undefined_behavior) may occur if this\nhappens.","schema":{"enum":["auto","local","secondary","remote"],"example":"auto","default":"auto","type":"string"},"in":"query","name":"alwaysaccept","required":"false"}],"description":"This function sets the Mail Exchanger (MX) type.\n\n**Note:**\n\n  This function **only** affects the cPanel configuration. You **must** configure the mail exchanger's DNS entry separately.\n\n**Important:**\n\nWhen you disable the [DNS role](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.","operationId":"set_always_accept","summary":"Update Mail Exchanger type","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  set_always_accept \\\n  domain='example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/set_always_accept?domain=example.com","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_set_always_accept.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_set_always_accept.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/Email/,\n    q/set_always_accept/,\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_set_always_accept.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_set_always_accept.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    'Email',\n    'set_always_accept',\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}"}],"tags":["Email","Email Server Information"]}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Server Information","description":"Email / Email Server Information"}],"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"set_manual_mx_redirects":{"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Accounts","name":"Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}],"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/set_manual_mx_redirects":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Email","description":"The name of the module called."},"result":{"properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"metadata":{"properties":{}},"data":{"properties":{"additionalProperties":{"type":"string","example":"mailhostexample.com","description":"The domain for which the function replaced the manual MX redirect entry.\n\n* null — The domain did not have an existing manual MX redirect entry.\n\n**Note:**\n\nThis return's name is the `domain` parameter's value.","nullable":"true"}},"type":"object","example":{"example.com":"mailhostexample.com"},"description":"A list of domains and the replaced manual MX redirect entries."},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"example":"set_manual_mx_redirects","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 96","parameters":[{"schema":{"example":"example.com","format":"domain","type":"string"},"examples":{"multiple":{"summary":"Add multiple manual MX redirect entries.","value":"example.com&domain-1=example1.com&domain-2=example2.com"},"single":{"summary":"Add a single manual MX redirect entry.","value":"'example.com'"}},"description":"The domain for which to add a manual MX redirect entry.\n\n**Note:**\n\n* To add multiple domain entries, increment the parameter. For example, use the `domain`, `domain-1`, and `domain-2` parameters.\n* For multiple domains, you **must** include its corresponding `mx_host` value.","required":"true","name":"domain","in":"query"},{"name":"mx_host","in":"query","required":"true","description":"The domain, IPv4, or IPv6 address to redirect the domain value's emails to.\n\n**Note:**\n\n * To add multiple MX hosts, increment the parameter. For example, use the `mx_host`, `mx_host-1`, and `mx_host-2` parameters.\n * For multiple MX hosts, you **must** include its corresponding `domain` value.","examples":{"single":{"summary":"Add a single manual MX host.","value":"'mailhostexample'"},"multiple":{"summary":"Add multiple manual MX hosts.","value":"mailhostexample&mx_host-1=mailhostexample&mx_host-2=mailhostexample"}},"schema":{"oneOf":[{"type":"string","description":"A domain name.","format":"domain"},{"type":"string","description":"An IPv4 address.","format":"ipv4"},{"description":"An IPv6 address.","format":"ipv6","type":"string"}]}}],"description":"This function lets you create a manual Exim mail exchanger (MX) redirect for a domain.\nAn MX redirection lets you bypass the domain's MX lookup via the Domain Name System (DNS).\nThis function adds the manual redirect entries to the `/etc/manualmx` file.\n\n**Note:**\n\n  To remove a domain's manual MX redirection, use the UAPI Email `unset_manual_mx_redirect` function.","operationId":"set_manual_mx_redirects","summary":"Add manual MX redirection","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty --user=username Email set_manual_mx_redirects domain='example.com' mx_host='mailhostexample.com'"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/set_manual_mx_redirects?domain=example.com&mx_host=mailhostexample.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_set_manual_mx_redirects.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_set_manual_mx_redirects.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/Email/,\n    q/set_manual_mx_redirects/,\n    {\n        'domain' => 'example.com',\n        'mx_host' => 'mailhostexample.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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_set_manual_mx_redirects.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_set_manual_mx_redirects.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    'Email',\n    'set_manual_mx_redirects',\n    array (\n        'domain' => 'example.com',\n        'mx_host' => 'mailhostexample.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}"}],"tags":["Email","Email Accounts"]}}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"has_plaintext_authentication":{"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"paths":{"/Email/has_plaintext_authentication":{"get":{"operationId":"has_plaintext_authentication","description":"This function checks whether plaintext authentication is enabled on the Dovecot mail server.\n\n**Important:**\n\n  When you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 56","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"has_plaintext_authentication","type":"string"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"result":{"type":"object","properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"data":{"description":"Whether plaintext authentication is enabled on the Dovecot mail server.\n* `1` - Enabled.\n* `0` - Disabled.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."}},"type":"object"}}}}},"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  has_plaintext_authentication\n"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/has_plaintext_authentication"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_has_plaintext_authentication.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_has_plaintext_authentication.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/Email/,\n    q/has_plaintext_authentication/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_has_plaintext_authentication.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_has_plaintext_authentication.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    'Email',\n    'has_plaintext_authentication'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Email Server Information"],"summary":"Return whether plaintext authentication is enabled","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"url":"https://{host}:{port}/execute"}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Server Information","name":"Email Server Information"}]},"store_filter":{"paths":{"/Email/store_filter":{"get":{"summary":"Create email filter","x-cpanel-api-version":"UAPI","x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  store_filter \\\n  filtername='coffee' \\\n  action*='deliver' \\\n  match*='contains' \\\n  part*='$header_from' \\\n  val*='coconut'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/store_filter?filtername=coffee&action%2a=deliver&match%2a=contains&part%2a=%24header_from&val%2a=coconut","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_store_filter.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_store_filter.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/Email/,\n    q/store_filter/,\n    {\n        'filtername' => 'coffee',\n        'action*' => 'deliver',\n        'match*' => 'contains',\n        'part*' => '$header_from',\n        'val*' => 'coconut',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_store_filter.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_store_filter.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    'Email',\n    'store_filter',\n    array (\n        'filtername' => 'coffee',\n        'action*' => 'deliver',\n        'match*' => 'contains',\n        'part*' => '$header_from',\n        'val*' => 'coconut',\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}"}],"tags":["Email","Email Filtering"],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"type":"string","description":"The name of the method called.","example":"store_filter"},"result":{"type":"object","properties":{"data":{"type":"object","properties":{"account":{"example":"user@example.com","description":"The filter's email address. The function only returns this value if it created a user-level filter.","format":"email","type":"string"}}},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed. Check the errors field for more details.","type":"integer"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"Email","description":"The name of the module called.","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"name":"account","in":"query","required":"false","description":"The email address, for user-level filters. If you do not use this parameter, the function creates an account-level filter.","schema":{"type":"string","example":"user@example.com","format":"email"}},{"description":"The filter name.","schema":{"type":"string","example":"coffee"},"in":"query","name":"filtername","required":"true"},{"required":"false","name":"oldfiltername","in":"query","schema":{"example":"pool","type":"string"},"description":"The name of an existing filter, to rename it. If you do not use this parameter, the function creates a new filter."},{"description":"The filter's action.\n\n* `deliver` - Deliver the message to the `dest*` address.\n* `fail` - Force a delivery failure.\n* `finish` - Stop processing the message.\n* `save` - Save the message to the `dest*` file.\n* `pipe` - Pipe the message to the `dest*` application.\n\n**Important:**\n\n* You **must** increment each action. For example, pass the first action as `action1` and the second action as `action2`.\n* This value **requires** the `FileStorage` role. For more information, read our [How to Use Server Profiles](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles) documentation.","examples":{"multiple":{"value":"action1=deliver action2=save","summary":"Use multiple filter actions."},"single":{"value":"deliver","summary":"Use a single filter action."}},"schema":{"anyOf":[{"enum":["deliver","fail","finish","save","pipe"],"type":"string"}]},"in":"query","name":"action*","required":"true"},{"required":"false","name":"dest*","in":"query","schema":{"default":"","anyOf":[{"type":"string","example":"cheesecloth@example.com","description":"A valid email address.","format":"email"},{"type":"string","description":"A valid file or application path.","format":"path","example":"/path/to/thing"}]},"description":"The destination for filtered mail.\n\n**Important:**\n\n * This parameter is **required** if the action value is `deliver`, `save`, or `pipe`.\n * You **must** increment each destination. For example, pass the first destination as `dest1` and the second destination as `dest2`.","examples":{"multiple":{"summary":"Use multiple destinations for filtered mail.","value":"dest1=user@example.com dest2=user2@example.com"},"single":{"value":"user@example.com","summary":"Use a single destination for filtered mail."}}},{"in":"query","name":"match*","required":"true","description":"The filter's [match type](http://www.exim.org/exim-html-current/doc/html/spec_html/filter_ch-exim_filter_files.html).\n* If the `val*` parameter is a string, use a string operator.\n* If the `val*` parameter is an integer, use a numeric operator.\n\nString operators:\n\n* `is`\n* `matches`\n* `contains`\n* `does not contain`\n* `begins`\n* `does not begin`\n* `ends`\n* `does not end`\n* `does not match`\n\nNumeric operators:\n\n* `is above`\n* `is not above`\n* `is below`\n* `is not below`\n\n**Important:**\n\n You **must** increment each match type. For example, pass the first match type as `match1` and the second match type as `match2`.","examples":{"single":{"summary":"Use a single match type.","value":"contains"},"multiple":{"value":"match1=contains match2=matches","summary":"Use multiple match types."}},"schema":{"anyOf":[{"type":"string","example":"matches","enum":["is","matches","contains","does not contain","begins","does not begin","ends","does not end","does not match","is above","is not above","is below","is not below"]}]}},{"description":"The connection between multiple conditions.\n\n**Important:**\n\nYou **must** increment each connection. For example, pass the first connection as `opt1` and the second connection as `opt2`.","examples":{"multiple":{"summary":"Use multiple connections between conditions.","value":"opt1=and opt2=and"},"single":{"value":"and","summary":"Use a single connection between conditions."}},"schema":{"anyOf":[{"type":"string","enum":["and","or"]}],"default":"and"},"name":"opt*","in":"query","required":"false"},{"examples":{"multiple":{"summary":"Query multiple email sections.","value":"part1=$header_from part2=$message_body"},"single":{"summary":"Query a single email section.","value":"$header_from"}},"description":"The email section to query.\n\n * `$h_x-Spam-Bar:` - Match against the message's spam score value, measured in plus(`+`) characters.\n * `$h_x-Spam-Score:` - Match against the message's spam score value.\n * `$h_X-Spam-Status:` - Match against whether the system detected the message as spam.\n * `$h_List-Id:` - Match against the message's `List-ID` header value.\n * `$header_from:` - Match against the `From:` section.\n * `$header_subject:` - Match against the `Subject:` section.\n * `$header_to:` - Match against the `To:` section.\n * `$reply_address:` - Match against the `Reply To:` section.\n * `$message_body:` - Match against the message's body.\n * `$message_headers:` - Match against the message's headers.\n * `foranyaddress $h_to:, $h_cc:` - Match against all message recipients.\n * `not delivered` - Match if the message is not queued for delivery.\n * `error_message` - Match if the incoming message is bounced.\n\n**Important:**\n\nYou **must** increment each section. For example, pass the first section as `part1` and the second section as `part2`.\n\n**Note:**\n\nGenerally, the recipient does **not** receive the `BCC` field in an email's header. For this reason you **cannot** use the `BCC` field in a filter.","schema":{"anyOf":[{"type":"string","enum":["$h_x-Spam-Bar","$h_x-Spam-Score","$h_X-Spam-Status","$h_List-id","$header_from","$header_subject","$header_to","$reply_address","$message_body","$message_headers","$h_to, $h_cc","not delivered","error_message"]}]},"name":"part*","in":"query","required":"true"},{"examples":{"multiple":{"summary":"Match multiple values.","value":"val1=coconut val2=12"},"single":{"summary":"Match a single value.","value":"coconut"}},"description":"The value to match.\n\n**Important:**\n\nYou **must** increment each value. For example, pass the first value as `val1` and the second value as `val2`.","schema":{"anyOf":[{"type":"string"},{"type":"integer"}]},"in":"query","name":"val*","required":"true"}],"description":"This function creates a new email filter. For more information about Exim filters, read [Exim's documentation](http://www.exim.org/exim-html-3.30/doc/html/filter.html).\n\n**Important:**\n\nWhen you disable the [*Receive Mail* role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.\n\n### Create multiple rules\n\nYou may create up to 4,096 separate sets of conditions in one filter. To do this, append numbers to the parameter names.\n\nTo create a filter with two sets of actions and conditions, use the following parameters:\n  * Assign the information for the first filter rule to the `action1`, `dest1`, `match1`, `opt1`, `part1`, and `val1` parameters.\n  * Assign the information for the second filter rule to the `action2`, `dest2`, `match2`, `opt2`, `part2`, and `val2` parameters.\n\nTo create a filter that uses one set of actions but two sets of conditions, use the following parameters:\n  * Assign the actions to the `action1` and `dest1` parameters.\n  * Assign the first set of conditions to the `match1`, `opt1`, `part1`, and `val1` parameters.\n  * Assign the second set of conditions to the `match2`, `opt2`, `part2`, and `val2` parameters.","operationId":"store_filter"}}},"x-tagGroups":[{"tags":["Email Filtering"],"name":"Email"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Filtering","name":"Email Filtering"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2"},"delete_forwarder":{"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Forwarding","name":"Email Forwarding"}],"paths":{"/Email/delete_forwarder":{"get":{"parameters":[{"required":"true","in":"query","name":"address","schema":{"example":"user@example.com","format":"email","type":"string"},"description":"The forwarder's email address."},{"schema":{"example":"fwdtome@example.com","type":"string"},"description":"The forwarder's destination.\n* A valid email address.\n* A script location.\n* A system account.","required":"true","in":"query","name":"forwarder"}],"description":"This function deletes an email forwarder.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"delete_forwarder","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"delete_forwarder","description":"The name of the method called.","type":"string"},"result":{"properties":{"messages":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null},"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"metadata":{"properties":{}},"data":{"type":"object","nullable":"true","default":null},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"module":{"description":"The name of the module called.","example":"Email","type":"string"}}}}}}},"x-cpanel-available-version":"cPanel 11.42","tags":["Email","Email Forwarding"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  delete_forwarder \\\n  address='user@example.com' \\\n  forwarder='fwdtome@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/delete_forwarder?address=user%40example.com&forwarder=fwdtome%40example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_delete_forwarder.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_delete_forwarder.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/Email/,\n    q/delete_forwarder/,\n    {\n        'address' => 'user@example.com',\n        'forwarder' => 'fwdtome@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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_delete_forwarder.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_delete_forwarder.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    'Email',\n    'delete_forwarder',\n    array (\n        'address' => 'user@example.com',\n        'forwarder' => 'fwdtome@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}"}],"x-cpanel-api-version":"UAPI","summary":"Delete email account's email forwarder"}}},"x-tagGroups":[{"name":"Email","tags":["Email Forwarding"]}],"openapi":"3.0.2","info":{"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"list_domain_forwarders":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"}},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"x-tagGroups":[{"name":"Email","tags":["Email Forwarding"]}],"paths":{"/Email/list_domain_forwarders":{"get":{"parameters":[{"required":"false","name":"domain","in":"query","schema":{"format":"domain","example":"example.com","type":"string"},"description":"The domain name to query. If you do not use this parameter, the function returns all domain-level forwarders on the cPanel account."}],"description":"This function lists domain-level forwarders.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_domain_forwarders","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Email","description":"The name of the module called."},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"type":"object","properties":{"warnings":{"nullable":"true","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"description":"An array of objects containing domain forwarder information.","items":{"properties":{"dest":{"type":"string","format":"domain","description":"The forwarded domain.","example":"example.com"},"forward":{"type":"string","example":"forwardtome.com","description":"The destination domain.","format":"domain"}},"type":"object"},"type":"array"}}},"func":{"type":"string","example":"list_domain_forwarders","description":"The name of the method called."}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_domain_forwarders\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_domain_forwarders","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_domain_forwarders.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_domain_forwarders.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/Email/,\n    q/list_domain_forwarders/\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 Perl","lang":"Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_domain_forwarders.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_domain_forwarders.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    'Email',\n    'list_domain_forwarders'\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}"}],"tags":["Email","Email Forwarding"],"summary":"Return domain-level forwarders","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Forwarding","name":"Email Forwarding"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}},"description":"A server running cPanel."}]},"get_main_account_disk_usage_bytes":{"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/Email/get_main_account_disk_usage_bytes":{"get":{"x-cpanel-available-version":"cPanel 64","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"Email","description":"The name of the module called.","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"properties":{"metadata":{"properties":{}},"data":{"type":"integer","description":"The current amount of disk space that the main email account uses, in bytes.","example":"3076"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success\n* `0` - Failed: Check the errors field for more details."},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"}},"type":"object"},"func":{"type":"string","example":"get_main_account_disk_usage_bytes","description":"The name of the method called."}},"type":"object"}}}}},"description":"This function returns the disk space that the cPanel account uses.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"get_main_account_disk_usage_bytes","parameters":[],"x-cpanel-api-version":"UAPI","summary":"Return primary email account's disk usage in bytes","tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_main_account_disk_usage_bytes\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_main_account_disk_usage_bytes","label":"URL","lang":"HTTP"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_main_account_disk_usage_bytes.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_main_account_disk_usage_bytes.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/Email/,\n    q/get_main_account_disk_usage_bytes/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_main_account_disk_usage_bytes.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_main_account_disk_usage_bytes.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    'Email',\n    'get_main_account_disk_usage_bytes'\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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}]},"get_filter":{"x-tagGroups":[{"name":"Email","tags":["Email Filtering"]}],"paths":{"/Email/get_filter":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_filter \\\n  account='user@example.com' \\\n  filtername='coffee'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_filter?account=user%40example.com&filtername=coffee"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_filter.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_filter.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/Email/,\n    q/get_filter/,\n    {\n        'account' => 'user@example.com',\n        'filtername' => 'coffee',\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 Perl","lang":"Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_filter.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_filter.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    'Email',\n    'get_filter',\n    array (\n        'account' => 'user@example.com',\n        'filtername' => 'coffee',\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}"}],"tags":["Email","Email Filtering"],"summary":"Return email filter's information","x-cpanel-api-version":"UAPI","parameters":[{"description":"The email address that owns the filter.","schema":{"format":"email","example":"user@example.com","type":"string"},"in":"query","name":"account","required":"true"},{"schema":{"type":"string","example":"coffee"},"description":"The filter's name.","required":"true","name":"filtername","in":"query"}],"operationId":"get_filter","description":"This function retrieves an email filter's information.\n\n**Important:**\n\nWhen you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"example":"Email","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"result":{"properties":{"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"object","properties":{"metadata":{"type":"object","properties":{"transformed":{"description":"Post-processing may have transformed the data.","example":"1","enum":["1"],"type":"integer"}}},"filtername":{"description":"The filter's name.","example":"coffee","type":"string"},"actions":{"description":"An array of objects that contains the filter's actions.","items":{"properties":{"dest":{"description":"The destination to which the filter sends mail.\n\nA destination can be one of the following.\n* A file path.\n* An application path.\n* A valid email address.","oneOf":[{"type":"string","format":"path","example":"/dev/null"},{"type":"string","example":"example@test.com","format":"email"}]},"action":{"description":"The filter's action.\n* `deliver` -  The filter sends mail to the destination address.\n* `fail` -  The filter forces a delivery failure.\n* `finish` -  The filter stops message processing.\n* `save` -  The filter saves mail to the destination file.\n* `pipe` -  The filter sends mail to the destination application.","enum":["deliver","fail","finish","save","pipe"],"type":"string"},"number":{"description":"The filter's position in the order of the account's filters.","example":"1","minimum":"1","type":"integer"}},"type":"object"},"type":"array"},"rules":{"items":{"type":"object","properties":{"val":{"example":"coconut","description":"The matched value.","type":"string"},"opt":{"type":"string","description":"The connection between multiple conditions.\n* `and` -  Match both conditions.\n* `or` -  Match either condition.\n* `null` -  There is only one condition.","enum":["and","or","null"],"example":"or"},"part":{"example":"$message_body","enum":["$header_from:","$header_subject:","$header_to:","$reply_address:","$message_body","$message_headers","foranyaddress $h_to:,$h_cc:,$h_bcc:","not delivered","error_message"],"description":"The queried email section.\n* `$header_from:` -  Matches against the From: section.\n* `$header_subject:` -  Matches against the Subject: section.\n* `$header_to:` -  Matches against the To: section.\n* `$reply_address:` -  Matches against the Reply To: section.\n* `$message_body` -  Matches against the message's body.\n* `$message_headers` -  Matches against the message's headers.\n* `foranyaddress $h_to:,$h_cc:,$h_bcc:` -  Matches against all message recipients.\n* `not delivered` -  Matches if the message is not queued for delivery.\n* `error_message` -  Matches if the incoming message bounced.","type":"string"},"match":{"type":"string","description":"The filter's match type.\n\n* `is`\n* `matches`\n* `contains`\n* `does not contain`\n* `begins`\n* `does not begin`\n* `ends`\n* `does not end`\n* `does not match`\n* `is above`\n* `is not above`\n* `is below`\n* `is not below`","example":"contains","enum":["is","matches","contains","does not contain","begins","does not begin","ends","does not end","does not match","is above","is not above","is below","is not below"]},"number":{"description":"The filter's position in the order of the account's filters.","example":"1","type":"integer","minimum":"1"}}},"description":"An array of objects that contains the filter's rules.","type":"array"}}},"warnings":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","type":"array"},"messages":{"type":"array","example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true"}},"type":"object"},"func":{"type":"string","description":"The name of the method called.","example":"get_filter"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Filtering","description":"Email / Email Filtering"}],"servers":[{"description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"url":"https://{host}:{port}/execute"}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}},"delete_list":{"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Mailing Lists","name":"Mailing Lists"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"tags":["Mailing Lists"],"name":"Email"}],"paths":{"/Email/delete_list":{"get":{"x-cpanel-api-version":"UAPI","summary":"Delete mailing list","tags":["Email","Mailing Lists"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  delete_list \\\n  list='mylist'\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/delete_list?list=mylist"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_delete_list.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_delete_list.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/Email/,\n    q/delete_list/,\n    {\n        'list' => 'mylist',\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_delete_list.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_delete_list.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    'Email',\n    'delete_list',\n    array (\n        'list' => 'mylist',\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}","lang":"PHP","label":"LiveAPI PHP"}],"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"Email","description":"The name of the module called.","type":"string"},"result":{"properties":{"status":{"type":"integer","enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"type":"array"},"data":{"type":"object","nullable":"true","default":null},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"example":"delete_list","description":"The name of the method called.","type":"string"}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 11.42","parameters":[{"schema":{"type":"string","example":"mylist"},"description":"The mailing list.","required":"true","name":"list","in":"query"}],"operationId":"delete_list","description":"This function deletes a Mailman mailing list.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function."}}},"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."}},"fetch_charmaps":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"}},"openapi":"3.0.2","x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/fetch_charmaps":{"get":{"x-cpanel-api-version":"UAPI","summary":"Return server's supported character encodings","tags":["Email","Email Server Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  fetch_charmaps\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/fetch_charmaps"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_fetch_charmaps.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_fetch_charmaps.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/Email/,\n    q/fetch_charmaps/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_fetch_charmaps.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_fetch_charmaps.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    'Email',\n    'fetch_charmaps'\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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"properties":{"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"data":{"type":"array","items":{"type":"object","properties":{"map":{"example":"utf-8","description":"A [character encoding](https://en.wikipedia.org/wiki/Character_encoding) that cPanel supports.","type":"string"}}}},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"example":"fetch_charmaps","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"description":"This function lists the available character encodings.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"fetch_charmaps","parameters":[]}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Server Information","description":"Email / Email Server Information"}],"servers":[{"description":"A server running cPanel.","variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"url":"https://{host}:{port}/execute"}]},"add_auto_responder":{"openapi":"3.0.2","security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Accounts","name":"Email Accounts"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/add_auto_responder":{"get":{"operationId":"add_auto_responder","description":"This function creates an autoresponder for an email account.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"required":"true","in":"query","name":"email","schema":{"example":"user","type":"string"},"description":"The email account name. For example, `user` if the email address is `user@example.com`."},{"name":"from","in":"query","required":"true","description":"The contents of the autoresponder message's `From:` field.","schema":{"example":"User Name","type":"string"}},{"description":"The contents of the autoresponder message's `Subject:` field.","schema":{"example":"Autoresponder Subject","type":"string"},"in":"query","name":"subject","required":"true"},{"description":"The contents of the autoresponder message's `Body` section.","schema":{"type":"string","example":"This is an autoresponder message."},"in":"query","name":"body","required":"true"},{"description":"The email account's domain. For example, `example.com` if the email address is `user@example.com`.","schema":{"type":"string","format":"domain","example":"example.com"},"in":"query","name":"domain","required":"true"},{"required":"true","name":"is_html","in":"query","schema":{"example":"1","enum":["0","1"],"type":"integer"},"description":"Whether the body of the autoresponder message begins with an [HTML Content-Type declaration](https://en.wikipedia.org/wiki/Character_encodings_in_HTML#Specifying_the_document.27s_character_encoding).\n* `1` — Include an HTML content type declaration.\n* `0` — Do **not** include an HTML content type declaration."},{"schema":{"type":"string","example":"UTF-8","default":"utf-8"},"description":"The [character set](https://en.wikipedia.org/wiki/Character_encoding).","required":"false","name":"charset","in":"query"},{"required":"true","in":"query","name":"interval","schema":{"example":"24","type":"integer","minimum":"0"},"description":"The amount of time, in hours, that the server waits between autoresponder messages to the same address.\n\n**Note:**\n\n  If you specify `0`, the system sends a message for each received email."},{"description":"When to enable the autoresponder.","schema":{"format":"unix_timestamp","example":"1410277881","type":"integer"},"in":"query","name":"start","required":"true"},{"required":"true","name":"stop","in":"query","schema":{"example":"1410300000","format":"unix_timestamp","type":"integer"},"description":"When to disable the autoresponder. A time that is after the `start` time."}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"example":"Email","description":"The name of the module called.","type":"string"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"messages":{"nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"type":"array"},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"data":{"nullable":"true","default":null,"type":"object"},"status":{"type":"integer","example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details."},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}}}},"func":{"type":"string","description":"The name of the method called.","example":"add_auto_responder"}}}}},"description":"HTTP Request was successful."}},"tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  add_auto_responder \\\n  email='user' \\\n  from='User Name' \\\n  subject='Autoresponder Subject' \\\n  body='This is an autoresponder message.' \\\n  domain='example.com' \\\n  is_html='1' \\\n  interval='24' \\\n  start='1410277881' \\\n  stop='1410300000'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/add_auto_responder?email=user&from=User%20Name&subject=Autoresponder%20Subject&body=This%20is%20an%20autoresponder%20message.&domain=example.com&is_html=1&interval=24&start=1410277881&stop=1410300000"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_add_auto_responder.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_add_auto_responder.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/Email/,\n    q/add_auto_responder/,\n    {\n        'email' => 'user',\n        'from' => 'User Name',\n        'subject' => 'Autoresponder Subject',\n        'body' => 'This is an autoresponder message.',\n        'domain' => 'example.com',\n        'is_html' => '1',\n        'interval' => '24',\n        'start' => '1410277881',\n        'stop' => '1410300000',\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_add_auto_responder.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_add_auto_responder.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    'Email',\n    'add_auto_responder',\n    array (\n        'email' => 'user',\n        'from' => 'User Name',\n        'subject' => 'Autoresponder Subject',\n        'body' => 'This is an autoresponder message.',\n        'domain' => 'example.com',\n        'is_html' => '1',\n        'interval' => '24',\n        'start' => '1410277881',\n        'stop' => '1410300000',\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}","label":"LiveAPI PHP","lang":"PHP"}],"x-cpanel-api-version":"UAPI","summary":"Create email account's autoresponder"}}}},"suspend_login":{"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"x-tagGroups":[{"tags":["Email Suspensions"],"name":"Email"}],"paths":{"/Email/suspend_login":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Email","type":"string"},"result":{"properties":{"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"},"metadata":{"properties":{}},"data":{"type":"object","default":null,"nullable":"true"},"errors":{"type":"array","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]}}},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"func":{"example":"suspend_login","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","parameters":[{"description":"The email user's account name.","schema":{"example":"user@example.com","format":"email","type":"string"},"name":"email","in":"query","required":"true"}],"description":"This function suspends a user's ability to log in to their email account. This function immediately suspends the user's login credentials and prevents future authenticated connections to the email account.\n\n**Notes:**\n\n* When you suspend an account, the user's account still receives email.\n* To suspend incoming email for an account, use the UAPI `Email::suspend_incoming` function.\n* To remove the login suspension for an account, use the UAPI `Email::unsuspend_login` function.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"suspend_login","x-cpanel-api-version":"UAPI","summary":"Suspend email account login","tags":["Email","Email Suspensions"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  suspend_login \\\n  email='user@example.com'\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/suspend_login?email=user%40example.com","lang":"HTTP","label":"URL"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_suspend_login.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_suspend_login.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/Email/,\n    q/suspend_login/,\n    {\n        'email' => 'user@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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_suspend_login.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_suspend_login.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    'Email',\n    'suspend_login',\n    array (\n        'email' => 'user@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}","label":"LiveAPI PHP","lang":"PHP"}]}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Suspensions","name":"Email Suspensions"}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel."}]},"enable_spam_box":{"paths":{"/Email/enable_spam_box":{"get":{"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  enable_spam_box\n","label":"CLI","lang":"Shell"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/enable_spam_box"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_enable_spam_box.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_enable_spam_box.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/Email/,\n    q/enable_spam_box/\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"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_enable_spam_box.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_enable_spam_box.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    'Email',\n    'enable_spam_box'\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}","label":"LiveAPI PHP","lang":"PHP"}],"tags":["Email","Spam Management"],"summary":"Enable spam box filtering for cPanel account","x-cpanel-api-version":"UAPI","description":"This function enables spam box filtering for a cPanel account. When you enable spam box filtering, the system sends messages marked as spam to a spam folder.\n\n**Notes:**\n\n* This function **requires** that your hosting provider enables Apache SpamAssassin on the server.\n* To **disable** spam box filtering, use the UAPI `Email::disable_spam_box` function.\n* For more information, read our [Spam Filters](https://go.cpanel.net/cpaneldocsSpamFilters) documentation.\n\n**Important:**\n\nWhen you disable the [Spam Filter](https://go.cpanel.net/serverroles) role, the system **disables** this function.","operationId":"enable_spam_box","parameters":[],"x-cpanel-available-version":"cPanel 70","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"module":{"example":"Email","description":"The name of the module called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"metadata":{"properties":{}},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","enum":["0","1"],"example":"1"},"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"default":null,"nullable":"true","type":"object"}}},"func":{"description":"The name of the method called.","example":"enable_spam_box","type":"string"}},"type":"object"}}}}}}}},"x-tagGroups":[{"name":"Email","tags":["Spam Management"]}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Spam Management","description":"Email / Spam Management"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"openapi":"3.0.2"},"get_mailbox_autocreate":{"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/get_mailbox_autocreate":{"get":{"responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"get_mailbox_autocreate","type":"string"},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"status":{"type":"integer","enum":["0","1"],"example":"1","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details."},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"type":"integer","description":"Whether the cPanel account can automatically create mailboxes.\n* `1` — The cPanel account can automatically create mailboxes.\n* `0` — The cPanel account **cannot** automatically create mailboxes.","enum":["0","1"],"example":"1"},"metadata":{"properties":{}},"warnings":{"type":"array","description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"example":null,"nullable":"true"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"}}}},"type":"object"}}}}},"x-cpanel-available-version":"cPanel 78","parameters":[{"schema":{"example":"username@example.com","format":"email","type":"string"},"description":"The email account address to query.","required":"true","in":"query","name":"email"}],"operationId":"get_mailbox_autocreate","description":"This function checks whether a cPanel account will automatically create mailboxes when it receives an email address in [plus address format](https://en.wikipedia.org/wiki/Email_address#Sub-addressing).\n\n**Note:**\n\nTo enable or disable this functionality, use the UAPI's `Email::enable_mailbox_autocreate` and `Email::disable_mailbox_autocreate` functions.","summary":"Return cPanel account's mailbox autocreate status","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_mailbox_autocreate \\\n  email='username@example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_mailbox_autocreate?email=username%40example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_mailbox_autocreate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_mailbox_autocreate.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/Email/,\n    q/get_mailbox_autocreate/,\n    {\n        'email' => 'username@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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_mailbox_autocreate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_mailbox_autocreate.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    'Email',\n    'get_mailbox_autocreate',\n    array (\n        'email' => 'username@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}"}],"tags":["Email","Email Server Information"]}}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Server Information","description":"Email / Email Server Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"openapi":"3.0.2"},"hold_outgoing":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"paths":{"/Email/hold_outgoing":{"get":{"x-cpanel-api-version":"UAPI","summary":"Stop email account's outgoing mail","tags":["Email","Email Accounts"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  hold_outgoing \\\n  email='username@example.com'\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/hold_outgoing?email=username%40example.com"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_hold_outgoing.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_hold_outgoing.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/Email/,\n    q/hold_outgoing/,\n    {\n        'email' => 'username@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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_hold_outgoing.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_hold_outgoing.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    'Email',\n    'hold_outgoing',\n    array (\n        'email' => 'username@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}"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"description":"The name of the method called.","example":"hold_outgoing","type":"string"},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"errors":{"example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"nullable":"true","type":"array"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"data":{"type":"object","nullable":"true","default":null},"metadata":{"properties":{}},"warnings":{"type":"array","nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"}}}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 70","parameters":[{"description":"The email account's username.","schema":{"type":"string","format":"email","example":"username@example.com"},"name":"email","in":"query","required":"true"}],"description":"This function sets Exim's queue to not send outgoing mail from an email account.\n\n**Notes:**\n\n* To send all mail from the queue, use the UAPI `Email::release_outgoing` function.\n* To reject outgoing mail and not place mail in a queue, use the UAPI `Email::suspend_outgoing` function.\n* This function does **not** hold local outgoing mail.","operationId":"hold_outgoing"}}},"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}],"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}},"openapi":"3.0.2","info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"}},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"}},"add_list":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Mailing Lists","description":"Email / Mailing Lists"}],"paths":{"/Email/add_list":{"get":{"tags":["Email","Mailing Lists"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  add_list \\\n  list='newlist' \\\n  password='12345luggage' \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/add_list?list=newlist&password=12345luggage&domain=example.com"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_add_list.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_add_list.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/Email/,\n    q/add_list/,\n    {\n        'list' => 'newlist',\n        'password' => '12345luggage',\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_add_list.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_add_list.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    'Email',\n    'add_list',\n    array (\n        'list' => 'newlist',\n        'password' => '12345luggage',\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}"}],"x-cpanel-api-version":"UAPI","summary":"Create mailing list","parameters":[{"description":"The mailing list name.","schema":{"type":"string","example":"newlist"},"in":"query","name":"list","required":"true"},{"description":"The mailing list password.","schema":{"type":"string","example":"12345luggage"},"name":"password","in":"query","required":"true"},{"in":"query","name":"domain","required":"true","description":"The domain.","schema":{"type":"string","example":"example.com","format":"domain"}},{"description":"Whether to rebuild the mailing list.\n* `1` — Rebuild the mailing list.\n* `0` — Do **not** rebuild the mailing list.","schema":{"default":"0","enum":["0","1"],"example":"0","type":"integer"},"in":"query","name":"rebuildonly","required":"false"},{"description":"Whether the mailing list is private.\n* `1` — Private.\n* `0` — Public.","schema":{"type":"integer","example":"0","enum":["0","1"],"default":"0"},"in":"query","name":"private","required":"false"}],"description":"This function creates a Mailman mailing list.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"add_list","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"add_list","description":"The name of the method called.","type":"string"},"result":{"properties":{"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"},"warnings":{"example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true","type":"array"},"data":{"type":"object","nullable":"true","default":null},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","example":"1","enum":["1"],"description":"Post-processing may have transformed the data."}}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"type":"string","example":"Email","description":"The name of the module called."}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.42"}}},"x-tagGroups":[{"name":"Email","tags":["Mailing Lists"]}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}]},"get_held_message_count":{"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"info":{"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"contact":{"url":"https://cpanel.net/support/","name":"WebPros International, LLC","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/get_held_message_count":{"get":{"x-cpanel-available-version":"cPanel 74","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"type":"string","description":"The name of the module called.","example":"Email"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"metadata":{"properties":{}},"errors":{"type":"array","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true"},"status":{"enum":["0","1"],"example":"1","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"minimum":"0","type":"integer","example":"0","description":"The number of messages currently held in the mail queue."},"warnings":{"type":"array","example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true"},"messages":{"example":null,"description":"List of messages generated by the API.","items":{"type":"string"},"nullable":"true","type":"array"}},"type":"object"},"func":{"type":"string","example":"get_held_message_count","description":"The name of the method called."}}}}}}},"operationId":"get_held_message_count","description":"This function returns the count of outbound email messages held in the mail queue for the specified email account.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"description":"The email address to query.","schema":{"example":"username@example.com","format":"email","type":"string"},"name":"email","in":"query","required":"false"}],"x-cpanel-api-version":"UAPI","summary":"Return email account's outgoing message count","tags":["Email","Email Accounts"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  get_held_message_count\n","label":"CLI","lang":"Shell"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/get_held_message_count","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_get_held_message_count.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_get_held_message_count.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/Email/,\n    q/get_held_message_count/\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_get_held_message_count.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_get_held_message_count.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    'Email',\n    'get_held_message_count'\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}","lang":"PHP","label":"LiveAPI PHP"}]}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"list_mxs":{"components":{"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}},"schemas":{}},"openapi":"3.0.2","info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI"},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"tags":[{"name":"Email DNS Settings","description":"DNS / Email DNS Settings"}],"paths":{"/Email/list_mxs":{"get":{"description":"This function lists Mail Exchanger (MX) records.\n\n**Important:**\n\n  When you disable the [*DNS* role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"list_mxs","parameters":[{"required":"false","name":"domain","in":"query","schema":{"type":"string","format":"domain","example":"example.com"},"description":"The domain to query. If you do **not** use this parameter, the function returns MX records for all of the cPanel account's domains."}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"properties":{"func":{"description":"The name of the method called.","example":"list_mxs","type":"string"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"messages":{"type":"array","description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true"},"warnings":{"nullable":"true","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"type":"array"},"metadata":{"properties":{"transformed":{"example":"1","enum":["1"],"description":"Post-processing may have transformed the data.","type":"integer"}}},"data":{"items":{"type":"object","properties":{"local":{"type":"integer","description":"Whether the domain's highest priority mail exchanger is a local mail exchanger.\n* `1` - Local.\n* `0` - **Not** local.","enum":["0","1"],"example":"1"},"domain":{"example":"example.com","description":"The domain name.","format":"domain","type":"string"},"alwaysaccept":{"type":"integer","description":"Whether the domain's highest-priority mail exchanger accepts local mail.\n* `1` - Accept local mail.\n* `0` - Does **not** accept local mail.","example":"1","enum":["0","1"]},"statusmsg":{"description":"A success or error message message.\n* A success message.\n* An error message.","example":"Fetched MX List","type":"string"},"entries":{"type":"array","description":"An array of objects that contains information about mail exchangers.","items":{"type":"object","properties":{"domain":{"type":"string","format":"domain","description":"The mail exchanger's domain.","example":"example.com"},"entrycount":{"type":"integer","minimum":"1","description":"The mail exchanger's order in the list of priorities. For example, the mail exchanger with the highest priority returns `1`, and the next highest priority returns `2`.","example":"1"},"row":{"type":"string","description":"Whether the mail exchanger is an odd or an even entry.\n* `even`\n* `odd`","example":"odd","enum":["even","odd"]},"priority":{"type":"integer","minimum":"0","example":"5","description":"The mail exchanger's [priority value](https://go.cpanel.net/whmdocsEditMXEntry)."},"mx":{"type":"string","example":"mx.example.com","format":"domain","description":"The mail exchanger's name."}}}},"remote":{"enum":["0","1"],"example":"0","description":"Whether the domain's highest-priority mail exchanger is remote.\n* `1` - Remote.\n* `0` - **Not** remote.","type":"integer"},"mx":{"type":"string","description":"The domain's highest-priority mail exchanger's name.","format":"domain","example":"mx.example.com"},"mxcheck":{"description":"The domain's highest-priority mail exchanger's type.\n* `auto`\n* `local`\n* `remote`\n* `secondary`","enum":["auto","local","remote","secondary"],"example":"auto","type":"string"},"secondary":{"description":"Whether the domain's highest-priority mail exchanger is secondary.\n* `1` - Secondary.\n* `0` - **Not** secondary.","example":"0","enum":["0","1"],"type":"integer"},"detected":{"type":"string","example":"local","enum":["auto","local","remote","secondary"],"description":"The domain's highest-priority mail exchanger's type.\n* `auto`\n* `local`\n* `remote`\n* `secondary`"},"status":{"description":"Whether the function succeeded.\n* `1` - Success.\n* `0` - Failure.","enum":["0","1"],"example":"1","type":"integer"}}},"properties":{},"type":"array"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1"}}}},"type":"object"}}}}},"x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_mxs\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_mxs","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_mxs.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_mxs.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/Email/,\n    q/list_mxs/\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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_mxs.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_mxs.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    'Email',\n    'list_mxs'\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}"}],"tags":["Email DNS Settings"],"summary":"Return mail exchanger records","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"DNS","tags":["Email DNS Settings"]}]},"enable_mailbox_autocreate":{"x-tagGroups":[{"tags":["Email Server Information"],"name":"Email"}],"paths":{"/Email/enable_mailbox_autocreate":{"get":{"parameters":[{"in":"query","name":"email","required":"true","description":"The email account for which to enable mailbox autocreation.","schema":{"type":"string","example":"username@example.com"}}],"description":"This function allows the system to automatically create mailboxes for a cPanel account. The system will create a new mailbox when it receives an email address in plus address format and that mailbox does not exist. For example, receiving an email from the user+newmailbox@example.com address creates the newmailbox mailbox if the newmailbox mailbox does not exist.\n\n**Note:**\n\n  To disable this functionality, use the UAPI Email::disable_mailbox_autocreate function.","operationId":"enable_mailbox_autocreate","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"func":{"example":"enable_mailbox_autocreate","description":"The name of the method called.","type":"string"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"result":{"properties":{"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"errors":{"nullable":"true","items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"data":{"type":"integer","description":"Whether the function enabled mailbox autocreation for the cPanel account.\n- 1  Mailbox autocreation enabled.\n- 0  Mailbox autocreation is not enabled.","example":"1","enum":["0","1"]},"metadata":{"properties":{}}},"type":"object"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"}}}}}}},"x-cpanel-available-version":"cPanel 78","tags":["Email","Email Server Information"],"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  enable_mailbox_autocreate \\\n  email='username@example.com'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/enable_mailbox_autocreate?email=username%40example.com"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_enable_mailbox_autocreate.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_enable_mailbox_autocreate.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/Email/,\n    q/enable_mailbox_autocreate/,\n    {\n        'email' => 'username@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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_enable_mailbox_autocreate.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_enable_mailbox_autocreate.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    'Email',\n    'enable_mailbox_autocreate',\n    array (\n        'email' => 'username@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}","lang":"PHP","label":"LiveAPI PHP"}],"x-cpanel-api-version":"UAPI","summary":"Enable cPanel account mailbox autocreation"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Server Information","description":"Email / Email Server Information"}],"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"}}}],"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/"},"openapi":"3.0.2","components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}}},"unsuspend_incoming":{"openapi":"3.0.2","externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"termsOfService":"https://cpanel.net/legal-notices/","version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Suspensions","description":"Email / Email Suspensions"}],"servers":[{"variables":{"port":{"description":"The cPanel port.","default":"2083"},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"x-tagGroups":[{"name":"Email","tags":["Email Suspensions"]}],"paths":{"/Email/unsuspend_incoming":{"get":{"summary":"Unsuspend email account incoming mail","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  unsuspend_incoming\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/unsuspend_incoming","lang":"HTTP","label":"URL"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_unsuspend_incoming.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_unsuspend_incoming.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/Email/,\n    q/unsuspend_incoming/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_unsuspend_incoming.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_unsuspend_incoming.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    'Email',\n    'unsuspend_incoming'\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}"}],"tags":["Email","Email Suspensions"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"description":"List of messages generated by the API.","items":{"type":"string"},"example":null,"nullable":"true","type":"array"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"description":"Whether the function succeeded.\n* `1` — The function succeeded.\n* `0` — The function failed.","enum":["0","1"],"example":"1","type":"integer"},"metadata":{"properties":{}}}},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"type":"string","description":"The name of the method called.","example":"unsuspend_incoming"}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 54","parameters":[{"schema":{"format":"email","example":"user@example.com","type":"string"},"description":"The email user's account name.","required":"false","name":"email","in":"query"}],"operationId":"unsuspend_incoming","description":"This function unsuspends incoming email for an email account.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function."}}}},"unsuspend_outgoing":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"info":{"title":"cPanel UAPI","contact":{"url":"https://cpanel.net/support/","email":"cs@cpanel.net","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","paths":{"/Email/unsuspend_outgoing":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"module":{"type":"string","example":"Email","description":"The name of the module called."},"result":{"properties":{"metadata":{"properties":{}},"status":{"type":"integer","description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","example":"1","enum":["1","0"]},"errors":{"nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"},"type":"array"},"data":{"type":"object","default":null,"nullable":"true"},"warnings":{"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true","type":"array"},"messages":{"type":"array","nullable":"true","description":"List of messages generated by the API.","items":{"type":"string"},"example":null}}},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"type":"string","example":"unsuspend_outgoing","description":"The name of the method called."}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 70","parameters":[{"required":"true","in":"query","name":"email","schema":{"type":"string","example":"username@example.com"},"description":"The email account's username."}],"operationId":"unsuspend_outgoing","description":"This function cancels the suspension action put in place by the UAPI `Email::suspend_outgoing`\nfunction for outgoing mail for an email account.\n\n**Note:**\n\nTo suspend an email account and reject all outgoing mail, use the UAPI `Email::suspend_outgoing` function.        ","summary":"Unsuspend email account outgoing mail","x-cpanel-api-version":"UAPI","x-codeSamples":[{"label":"CLI","lang":"Shell","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  unsuspend_outgoing \\\n  email='username@example.com'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/unsuspend_outgoing?email=username%40example.com","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_unsuspend_outgoing.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_unsuspend_outgoing.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/Email/,\n    q/unsuspend_outgoing/,\n    {\n        'email' => 'username@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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_unsuspend_outgoing.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_unsuspend_outgoing.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    'Email',\n    'unsuspend_outgoing',\n    array (\n        'email' => 'username@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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Suspensions"]}}},"x-tagGroups":[{"name":"Email","tags":["Email Suspensions"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"name":"Email Suspensions","description":"Email / Email Suspensions"}]},"verify_password":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"version":"11.89.0.9999","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel."}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Accounts","name":"Email Accounts"}],"paths":{"/Email/verify_password":{"get":{"summary":"Validate email account password","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  verify_password \\\n  email='username@example.com' \\\n  password='123456luggage'\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/verify_password?email=username%40example.com&password=123456luggage"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_verify_password.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_verify_password.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/Email/,\n    q/verify_password/,\n    {\n        'email' => 'username@example.com',\n        'password' => '123456luggage',\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","lang":"Perl","label":"LiveAPI Perl"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_verify_password.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_verify_password.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    'Email',\n    'verify_password',\n    array (\n        'email' => 'username@example.com',\n        'password' => '123456luggage',\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}"}],"tags":["Email","Email Accounts"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"result":{"type":"object","properties":{"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"example":null,"items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","nullable":"true","type":"array"},"data":{"type":"integer","description":"Whether the password is valid for the email account.\n* `1` - The password is valid.\n* `0` - The password is **not** valid.","example":"1","enum":["0","1"]},"errors":{"type":"array","description":"List of errors if the API failed.","items":{"type":"string"},"example":null,"nullable":"true"},"status":{"type":"integer","description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","example":"1","enum":["0","1"]},"metadata":{"properties":{}}}},"apiversion":{"type":"integer","example":"3","description":"The version of the API."},"module":{"type":"string","description":"The name of the module called.","example":"Email"},"func":{"example":"verify_password","description":"The name of the method called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 11.52","parameters":[{"required":"true","in":"query","name":"email","schema":{"format":"email","example":"username@example.com","type":"string"},"description":"The email account address."},{"description":"The email account password.","schema":{"example":"123456luggage","type":"string"},"name":"password","in":"query","required":"true"}],"description":"This function verifies the password for an email account.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles), the system **disables** this function.","operationId":"verify_password"}}},"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}]},"add_forwarder":{"info":{"contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"openapi":"3.0.2","components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"paths":{"/Email/add_forwarder":{"get":{"description":"This function creates an email forwarder.\n\n**Important:**\n\n  When you disable the MailReceive role, the system disables this function. \n  For more information, read our [How to Use Server Profiles](https://go.cpanel.net/howtouseserverprofiles) \n  documentation.","operationId":"add_forwarder","parameters":[{"name":"domain","in":"query","required":"true","description":"The domain.","schema":{"type":"string","example":"example.com"}},{"in":"query","name":"email","required":"true","description":"The email address to forward.","schema":{"type":"string","example":"forwardme@example.com"}},{"in":"query","name":"fwdopt","required":"true","description":"The method to use to handle the email address's mail.","schema":{"example":"fwd","type":"string"}},{"description":"The email address to which the system forwards messages.\n\n**Note:**\n\n You must use this parameter if you used the fwd method for the fwdopt parameter. You can pass multiple addresses to this parameter as a comma-separated list.","schema":{"type":"string","example":"fwdtome@example.com"},"name":"fwdemail","in":"query","required":"false"},{"schema":{"example":"user","type":"string"},"description":"The system user to whom the system forwards messages.\n\n**Note:**\n\n You must use this parameter if you used the system method for the fwdopt parameter.","required":"false","name":"fwdsystem","in":"query"},{"name":"failmsgs","in":"query","required":"false","description":"The failure message for the message's sender.\n\n**Note:**\n\n Use this parameter if you used the fail method for the fwdopt parameter.","schema":{"type":"string","default":"No such person at this address","example":"Nobody home."}},{"description":"The application to which the system pipes messages.\n\n**Note:**\n\n You must use this parameter if you used the pipe method for the fwdopt parameter.\n\n**Important:**\n\n  This parameter requires the FileStorage role. For more information, read our \n  [How to Use Server Profiles](https://go.cpanel.net/howtouseserverprofiles) documentation.","schema":{"type":"string","example":"mailscript.pl"},"in":"query","name":"pipefwd","required":"false"}],"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","example":"add_forwarder","description":"The name of the method called."},"result":{"type":"object","properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true","type":"array"},"errors":{"type":"array","nullable":"true","description":"List of errors if the API failed.","items":{"type":"string"},"example":null},"status":{"example":"1","enum":["0","1"],"description":"- 1 - Success\n- 0 - Failed: Check the errors field for more details.","type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","example":"user@example.com","description":"The email address. An email address on the account."},"forward":{"type":"string","description":"The method that the system will use to handle the address's mail.\n- An email address  The system forwards mail to this address.\n- :fail:  The system bounces mail back to the sender and sends a failure message.\n- :blackhole:  The system deletes mail without a failure message.\n- The path to an application  The system pipes mail to this application.\n- A username  The system forwards mail to this system account.","example":"fwdtome@example.com"},"domain":{"description":"The domain. A valid domain on the account.","example":"example.com","type":"string"}}}},"metadata":{"properties":{"transformed":{"description":"Post-processing may have transformed the data.","enum":["1"],"example":"1","type":"integer"}}}}},"apiversion":{"example":"3","description":"The version of the API.","type":"integer"},"module":{"example":"Email","description":"The name of the module called.","type":"string"}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  add_forwarder \\\n  domain='example.com' \\\n  email='forwardme@example.com' \\\n  fwdopt='fwd'\n"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/add_forwarder?domain=example.com&email=forwardme%40example.com&fwdopt=fwd","lang":"HTTP","label":"URL"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_add_forwarder.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_add_forwarder.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/Email/,\n    q/add_forwarder/,\n    {\n        'domain' => 'example.com',\n        'email' => 'forwardme@example.com',\n        'fwdopt' => 'fwd',\n    }\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","lang":"Perl","label":"LiveAPI Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_add_forwarder.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_add_forwarder.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    'Email',\n    'add_forwarder',\n    array (\n        'domain' => 'example.com',\n        'email' => 'forwardme@example.com',\n        'fwdopt' => 'fwd',\n    )\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Forwarding"],"summary":"Create email account forwarder","x-cpanel-api-version":"UAPI"}}},"x-tagGroups":[{"name":"Email","tags":["Email Forwarding"]}],"servers":[{"url":"https://{host}:{port}/execute","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel."}],"tags":[{"name":"Email","description":"The Email module for UAPI."},{"description":"Email / Email Forwarding","name":"Email Forwarding"}]},"count_auto_responders":{"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}},"externalDocs":{"url":"https://cpanel.net/developers/"},"security":[{"BasicAuth":[]}],"info":{"title":"cPanel UAPI","contact":{"email":"cs@cpanel.net","url":"https://cpanel.net/support/","name":"WebPros International, LLC"},"description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","termsOfService":"https://cpanel.net/legal-notices/","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"version":"11.89.0.9999"},"openapi":"3.0.2","x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"paths":{"/Email/count_auto_responders":{"get":{"operationId":"count_auto_responders","description":"This function returns the number of [autoresponders](https://go.cpanel.net/Autoresponders) for every email address on a cPanel account.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","parameters":[],"x-cpanel-available-version":"cPanel 82","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"func":{"type":"string","description":"The name of the method called.","example":"count_auto_responders"},"module":{"description":"The name of the module called.","example":"Email","type":"string"},"apiversion":{"description":"The version of the API.","example":"3","type":"integer"},"result":{"type":"object","properties":{"data":{"example":"1","description":"The number of email autoresponders.\n* `0`\n* A positive integer.","type":"integer","minimum":"0"},"status":{"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","enum":["0","1"],"example":"1","type":"integer"},"errors":{"nullable":"true","example":null,"items":{"type":"string"},"description":"List of errors if the API failed.","type":"array"},"metadata":{"properties":{"transformed":{"type":"integer","enum":["1"],"example":"1","description":"Post-processing may have transformed the data."}}},"messages":{"type":"array","example":null,"items":{"type":"string"},"description":"List of messages generated by the API.","nullable":"true"},"warnings":{"nullable":"true","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"type":"array"}}}},"type":"object"}}},"description":"HTTP Request was successful."}},"x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  count_auto_responders\n","lang":"Shell","label":"CLI"},{"label":"URL","lang":"HTTP","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/count_auto_responders"},{"label":"LiveAPI Perl","lang":"Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_count_auto_responders.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_count_auto_responders.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/Email/,\n    q/count_auto_responders/\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":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_count_auto_responders.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_count_auto_responders.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    'Email',\n    'count_auto_responders'\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}"}],"tags":["Email","Email Accounts"],"summary":"Return cPanel account's autoresponders total","x-cpanel-api-version":"UAPI"}}},"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"name":"Email Accounts","description":"Email / Email Accounts"}],"servers":[{"variables":{"host":{"default":"cpanel-server.tld","description":"The hostname of a server running cPanel"},"port":{"description":"The cPanel port.","default":"2083"}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}]},"terminate_mailbox_sessions":{"openapi":"3.0.2","info":{"contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"scheme":"basic","type":"http"}}},"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"paths":{"/Email/terminate_mailbox_sessions":{"get":{"tags":["Email","Email Accounts"],"x-codeSamples":[{"lang":"Shell","label":"CLI","source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  terminate_mailbox_sessions\n"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/terminate_mailbox_sessions"},{"lang":"Perl","label":"LiveAPI Perl","source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_terminate_mailbox_sessions.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_terminate_mailbox_sessions.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/Email/,\n    q/terminate_mailbox_sessions/\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"},{"lang":"PHP","label":"LiveAPI PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_terminate_mailbox_sessions.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_terminate_mailbox_sessions.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    'Email',\n    'terminate_mailbox_sessions'\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","summary":"Stop cPanel account IMAP and POP3 connections","parameters":[],"description":"This function terminates all IMAP and POP3 connections for a cPanel account.\n\n**Note:**\n\nThis function ends connections for every email address, which includes the [default address](https://go.cpanel.net/cpaneldocsDefaultAddress).","operationId":"email-terminate_mailbox_sessions","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"properties":{"result":{"type":"integer","description":"* `1` - Success.\n* `0` - Failed. Check the `reason` field for more details.","example":"1","enum":["0","1"]},"command":{"type":"string","description":"The method name called.","example":"terminate_mailbox_sessions"},"version":{"description":"The version of the API function.","example":"1","type":"integer"},"reason":{"type":"string","description":"The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds.","example":"OK"}}}}}}},"description":"HTTP Request was successful."}},"x-cpanel-available-version":"cPanel 96"}}},"x-tagGroups":[{"tags":["Email Accounts"],"name":"Email"}]},"list_auto_responders":{"servers":[{"variables":{"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"},"port":{"default":"2083","description":"The cPanel port."}},"description":"A server running cPanel.","url":"https://{host}:{port}/execute"}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Accounts","name":"Email Accounts"}],"paths":{"/Email/list_auto_responders":{"get":{"x-cpanel-available-version":"cPanel 11.42","responses":{"200":{"description":"HTTP Request was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"module":{"description":"The name of the module called.","example":"Email","type":"string"},"result":{"properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","example":null,"nullable":"true"},"messages":{"nullable":"true","items":{"type":"string"},"description":"List of messages generated by the API.","example":null,"type":"array"},"errors":{"items":{"type":"string"},"description":"List of errors if the API failed.","example":null,"nullable":"true","type":"array"},"status":{"example":"1","enum":["0","1"],"description":"* `1` - Success.\n* `0` - Failed. Check the `errors` field for more details.","type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"subject":{"type":"string","description":"The contents of the autoresponder message's `Subject:` field.","example":"Autoresponder Subject"},"email":{"example":"user@example.com","format":"email","description":"The autoresponder's email address.","type":"string"}}}},"metadata":{"properties":{"transformed":{"type":"integer","description":"Post-processing may have transformed the data.","example":"1","enum":["1"]}}}},"type":"object"},"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"func":{"example":"list_auto_responders","description":"The name of the method called.","type":"string"}}}}}}},"operationId":"list_auto_responders","description":"This function lists a domain's autoresponders.\n\n**Important:**\n\n  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles), the system **disables** this function.","parameters":[{"required":"true","in":"query","name":"domain","schema":{"type":"string","format":"domain","example":"example.com"},"description":"The domain name."},{"required":"false","name":"regex","in":"query","schema":{"type":"string","example":"user"},"description":"A [Perl Compatible Regular Expression (PCRE)](https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) that filters the results."}],"summary":"Return domain's autoresponders","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  list_auto_responders \\\n  domain='example.com'\n","lang":"Shell","label":"CLI"},{"source":"https://hostname.example.com:2083/cpsess##########/execute/Email/list_auto_responders?domain=example.com","label":"URL","lang":"HTTP"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_list_auto_responders.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_list_auto_responders.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/Email/,\n    q/list_auto_responders/,\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    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","lang":"Perl","label":"LiveAPI Perl"},{"label":"LiveAPI PHP","lang":"PHP","source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_list_auto_responders.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_list_auto_responders.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    'Email',\n    'list_auto_responders',\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    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}"}],"tags":["Email","Email Accounts"]}}},"x-tagGroups":[{"name":"Email","tags":["Email Accounts"]}],"openapi":"3.0.2","info":{"title":"cPanel UAPI","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"termsOfService":"https://cpanel.net/legal-notices/","license":{"url":"https://cpanel.net/legal-notices/","name":"cPanel License"},"version":"11.89.0.9999","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings."},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{}}},"unsuspend_login":{"servers":[{"url":"https://{host}:{port}/execute","description":"A server running cPanel.","variables":{"port":{"default":"2083","description":"The cPanel port."},"host":{"description":"The hostname of a server running cPanel","default":"cpanel-server.tld"}}}],"tags":[{"description":"The Email module for UAPI.","name":"Email"},{"description":"Email / Email Suspensions","name":"Email Suspensions"}],"paths":{"/Email/unsuspend_login":{"get":{"summary":"Unsuspend email account login","x-cpanel-api-version":"UAPI","x-codeSamples":[{"source":"uapi --output=jsonpretty \\\n  --user=username \\\n  Email \\\n  unsuspend_login\n","label":"CLI","lang":"Shell"},{"lang":"HTTP","label":"URL","source":"https://hostname.example.com:2083/cpsess##########/execute/Email/unsuspend_login"},{"source":"#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file Email_unsuspend_login.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/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/Email_unsuspend_login.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/Email/,\n    q/unsuspend_login/\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 Perl","lang":"Perl"},{"source":"<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file Email_unsuspend_login.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/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/Email_unsuspend_login.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    'Email',\n    'unsuspend_login'\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}","lang":"PHP","label":"LiveAPI PHP"}],"tags":["Email","Email Suspensions"],"x-cpanel-available-version":"cPanel 54","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiversion":{"type":"integer","description":"The version of the API.","example":"3"},"result":{"properties":{"warnings":{"type":"array","example":null,"description":"List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.","items":{"type":"string"},"nullable":"true"},"messages":{"type":"array","nullable":"true","example":null,"items":{"type":"string"},"description":"List of messages generated by the API."},"metadata":{"properties":{}},"status":{"example":"1","enum":["1","0"],"description":"* `1` — Success.\n* `0` — Failed. Check the `errors` field for more details.","type":"integer"},"errors":{"type":"array","nullable":"true","example":null,"description":"List of errors if the API failed.","items":{"type":"string"}},"data":{"type":"object","nullable":"true","default":null}}},"module":{"example":"Email","description":"The name of the module called.","type":"string"},"func":{"example":"unsuspend_login","description":"The name of the method called.","type":"string"}}}}},"description":"HTTP Request was successful."}},"operationId":"unsuspend_login","description":"This function restores a user's ability to log in to their email account.\n\n**Note:**\n\n* To suspend a user's ability to log in, use the UAPI `Email::suspend_login` function.\n* To suspend incoming email for an account, use the UAPI `Email::suspend_incoming` function.\n\n**Important:**\n\nWhen you disable the [Receive Mail role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.","parameters":[{"description":"The email user's account name.","schema":{"type":"string","format":"email","example":"username@example.com"},"in":"query","name":"email","required":"false"}]}}},"x-tagGroups":[{"tags":["Email Suspensions"],"name":"Email"}],"openapi":"3.0.2","info":{"version":"11.89.0.9999","license":{"name":"cPanel License","url":"https://cpanel.net/legal-notices/"},"termsOfService":"https://cpanel.net/legal-notices/","description":"UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.","contact":{"name":"WebPros International, LLC","url":"https://cpanel.net/support/","email":"cs@cpanel.net"},"title":"cPanel UAPI"},"security":[{"BasicAuth":[]}],"externalDocs":{"url":"https://cpanel.net/developers/"},"components":{"schemas":{},"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}}}}}}