latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

Server Administration
Services

Restart service

This function restarts a service, or daemon, on a server.

Note:

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

get/restartservice

Query parameters

servicestring required
Example:exim

The service to restart. For a list of possible values, read our Access Control List (ACL) documentation.

queue_task0 | 1

Whether to queue this task.

  • 1 — Queue.
  • 0 — Do not queue.

Note:

This parameter affects the output return.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "output": "Waiting for httpd to restart..............finished.\\n\\nhttpd (/usr/local/apache/bin/httpd -k start -DSSL) running as root with PID 21379\\nhttpd (/usr/local/apache/bin/httpd -k start -DSSL) running as root with PID 21385\\n\\nhttpd started ok\\n",
    "service": "exim"
  },
  "metadata": {
    "command": "restartservice",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}