latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

Server Administration
Services

Enable or disable a service and its monitoring

This function enables or disables a service and its monitoring.

Note:

If the user only possesses the clustering Access Control List (ACL), then this function can only act on the named service.

get/configureservice

Query parameters

service'apache_php_fpm' | 'cpanel-dovecot-solr' | 'cpanel_php_fpm' | 'cpanellogd' | 'cpdavd' | 'cphulkd' | 'cpsrvd' | 'crond' | 'dnsadmin' | 'exim' | 'exim-altport' | 'ftpd' | 'httpd' | 'imap' | 'ipaliases' | 'lmtp' | 'mailman' | 'mysql' | 'named' | 'nscd' | 'p0f' | 'pop' | 'postgresql' | 'queueprocd' | 'rsyslogd' | 'spamd' | 'sshd' required
Example:mysql

The service to configure. For more information about each service, read our Service Manager documentation.

enabled0 | 1
Example:1

Whether to enable the service.

  • 1 — Enable.
  • 0 — Disable.

If you do not use this parameter, the function will not change the enabled status of the service.

Warning:

Do not use this function to disable the cpsrvd service.

exim-altportnumstring
Example:26, 5000, 6000

A port or list of comma-separated ports on which Exim will listen for inbound connections.

Note:

The function only uses this parameter if you set exim-altport as the service parameter's value.

monitored0 | 1
Example:1

Whether to monitor the service in WHM's Service Status interface (WHM >> Home >> Server Status >> Service Status).

  • 1 — Monitor.
  • 0 — Do not monitor.

If you do not use this parameter, the function will not change the monitoring status of the service.

Response

HTTP Request was successful.

Example response

{
  "metadata": {
    "command": "configureservice",
    "reason": "Enabled monitoring for mysql.",
    "result": 1,
    "version": 1
  }
}