Using REST API to execute Karaf commands

  Written by The Jahia Team
   Estimated reading time:

Karaf commands can be executed through a REST endpoint, located at:


The endpoint accepts POST requests and is only available for users who have permission to use Jahia Tools. For information on Jahia Tools permissions, see Managing roles and permissions.

A simple command can be passed as the last part of the path:

curl -u 'root:root' -X POST  http://localhost:8080/modules/api/commands/bundle:list

If the command contains parameters and you don't want to url-encode it, it can also be passed as plain text content body:

curl -u 'root:root'  -H "content-Type: text/plain" -X POST -d 'bundle:list -t 0 -s' http://localhost:8080/modules/api/commands

The result is sent as a JSON object. It contains an "output" field for plain text answer, and a "resultsTable" if the command was returning a table. For example, the bundle:list command will return something like:

  "output": [
    "START LEVEL 100 , List Threshold: 50"
  "resultsTable": [
      "Name":"Apache Karaf :: Diagnostic :: Boot"
    }, ...