rego4k server version 1

The routes of the modules docs, policies, signing, debugger, shaking

The JSON of this description: /openapi.json

GET /bundles

The bundles of the server, with the revision and the hash of each bundle

The hash is the policy of a signed decision. The default bundle is at the paths of OPA's API, and each bundle is at /bundles/{name}.

Responses

200 OK

application/json object

  • bundles: array of object
    • name: string
    • revision: string
    • sha256: string
{
  "bundles": [
    {
      "name": "default",
      "revision": "r1",
      "sha256": "9a1c..."
    },
    {
      "name": "billing",
      "revision": "2026-12-01",
      "sha256": "4413..."
    }
  ]
}

GET /bundles/{name}/v1/data

Evaluate the document at the path, with the input of the parameter input

As OPA's Data API. The response is {} if the document is undefined. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
inputqueryarray of stringnoThe input document, as JSON text
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
provenancequeryarray of booleannoIf true, the response has the version of rego4k and the revision of each bundle
namepathstringyesThe name of a bundle, for example billing

Responses

200 OK

application/json object

  • result: boolean
{
  "result": true
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

POST /bundles/{name}/v1/data

Evaluate the document at the path, with the input of the body

As OPA's Data API. The response is {} if the document is undefined. With no input, it has a warning. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
provenancequeryarray of booleannoIf true, the response has the version of rego4k and the revision of each bundle
namepathstringyesThe name of a bundle, for example billing

Request body

application/json object

  • input: object
    • user: string
{
  "input": {
    "user": "alice"
  }
}

Responses

200 OK

application/json object

  • result: boolean
{
  "result": true
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

GET /bundles/{name}/v1/data/{path}

Evaluate the document at the path, with the input of the parameter input

As OPA's Data API. The response is {} if the document is undefined. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
inputqueryarray of stringnoThe input document, as JSON text
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
provenancequeryarray of booleannoIf true, the response has the version of rego4k and the revision of each bundle
namepathstringyesThe name of a bundle, for example billing
pathpathstringyesThe path of the document in data, with / between its parts, for example authz/allow

Responses

200 OK

application/json object

  • result: boolean
{
  "result": true
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

POST /bundles/{name}/v1/data/{path}

Evaluate the document at the path, with the input of the body

As OPA's Data API. The response is {} if the document is undefined. With no input, it has a warning. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
provenancequeryarray of booleannoIf true, the response has the version of rego4k and the revision of each bundle
namepathstringyesThe name of a bundle, for example billing
pathpathstringyesThe path of the document in data, with / between its parts, for example authz/allow

Request body

application/json object

  • input: object
    • user: string
{
  "input": {
    "user": "alice"
  }
}

Responses

200 OK

application/json object

  • result: boolean
{
  "result": true
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

GET /bundles/{name}/v1/policies

The modules of the bundle

As OPA's Policy API. The ID of a module is the name of the bundle and the path of the module. OPA also gives the AST.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
namepathstringyesThe name of a bundle, for example billing

Responses

200 OK

application/json object

  • result: array of object
    • id: string
    • raw: string
{
  "result": [
    {
      "id": "default/authz/policy.rego",
      "raw": "package authz\n\nallow if input.user == \"alice\"\n"
    }
  ]
}

DELETE /bundles/{name}/v1/policies/{id}

Refused: a bundle owns all the paths

As OPA with a bundle: a delete of a module gets 400, and a delete of a module that does not exist gets 404.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
namepathstringyesThe name of a bundle, for example billing
idpathstringyesThe ID of a policy module: the name of the bundle, then the path of the module in the bundle

Responses

400 Bad Request

application/json object

  • code: string
  • message: string
{
  "code": "invalid_parameter",
  "message": "all paths owned by bundle \"default\""
}

404 Not Found

application/json object

  • code: string
  • message: string
{
  "code": "resource_not_found",
  "message": "storage_not_found_error: policy id \"default/x.rego\""
}

GET /bundles/{name}/v1/policies/{id}

A module of the bundle

As OPA's Policy API. The ID is the name of the bundle and the path of the module, for example default/authz/policy.rego.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
namepathstringyesThe name of a bundle, for example billing
idpathstringyesThe ID of a policy module: the name of the bundle, then the path of the module in the bundle

Responses

200 OK

application/json object

  • result: object
    • id: string
    • raw: string
{
  "result": {
    "id": "default/authz/policy.rego",
    "raw": "package authz\n\nallow if input.user == \"alice\"\n"
  }
}

404 Not Found

application/json object

  • code: string
  • message: string
{
  "code": "resource_not_found",
  "message": "storage_not_found_error: policy id \"default/x.rego\""
}

PUT /bundles/{name}/v1/policies/{id}

Refused: a bundle owns all the paths

As OPA with a bundle: each write gets 400.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
namepathstringyesThe name of a bundle, for example billing
idpathstringyesThe ID of a policy module: the name of the bundle, then the path of the module in the bundle

Responses

400 Bad Request

application/json object

  • code: string
  • message: string
{
  "code": "invalid_parameter",
  "message": "all paths owned by bundle \"default\""
}

GET /bundles/{name}/v1/query

Evaluate the Rego query of the parameter q

As OPA's Query API. The query has no input. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
qqueryarray of stringnoThe Rego query
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
namepathstringyesThe name of a bundle, for example billing

Responses

200 OK

application/json object

  • result: array of object
    • x: string
{
  "result": [
    {
      "x": "alice"
    }
  ]
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

POST /bundles/{name}/v1/query

Evaluate a Rego query, with the input

As OPA's Query API. The result has the bindings of the vars of each solution, or it is {} if there is none. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
namepathstringyesThe name of a bundle, for example billing

Request body

application/json object

  • input: object
    • user: string
  • query: string
{
  "input": {
    "user": "alice"
  },
  "query": "x := input.user"
}

Responses

200 OK

application/json object

  • result: array of object
    • x: string
{
  "result": [
    {
      "x": "alice"
    }
  ]
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

GET /bundles/{name}/v1/shaking

Show what tree shaking does to each file of the bundle, for the entrypoints, without a change to the bundle

For each module and data file: the lines that the shaken bundle keeps, deletes and adds, and the shaken text. A removed file has no shaken text. The response also has the builtins that the shaken bundle needs, and the numbers of lines and files.

Parameters

NameInTypeRequiredDescription
entrypointqueryarray of stringyesAn entrypoint, in the form of opa build -e, for example authz/allow. Give the parameter one time for each entrypoint
namepathstringyesThe name of a bundle, for example billing

Responses

200 OK

application/json object

  • builtins: array of string
  • bundle: string
  • counts: object
    • addedLines: integer
    • deletedLines: integer
    • keptFiles: integer
    • keptLines: integer
    • removedFiles: integer
  • entrypoints: array of string
  • files: array of object
    • addedLines: integer
    • deletedLines: integer
    • keptLines: integer
    • lines: array of object
      • change: string
      • row: integer
      • shakenRow: integer
      • text: string
    • path: string
    • removed: boolean
    • shaken: string
  • removedFiles: array of string
{
  "builtins": [
    "equal"
  ],
  "bundle": "default",
  "counts": {
    "addedLines": 0,
    "deletedLines": 4,
    "keptFiles": 1,
    "keptLines": 3,
    "removedFiles": 1
  },
  "entrypoints": [
    "authz/allow"
  ],
  "files": [
    {
      "addedLines": 0,
      "deletedLines": 2,
      "keptLines": 3,
      "lines": [
        {
          "change": "kept",
          "row": 1,
          "shakenRow": 1,
          "text": "package authz"
        },
        {
          "change": "kept",
          "row": 2,
          "shakenRow": 2,
          "text": ""
        },
        {
          "change": "kept",
          "row": 3,
          "shakenRow": 3,
          "text": "allow if input.user == \"admin\""
        },
        {
          "change": "deleted",
          "row": 4,
          "text": ""
        },
        {
          "change": "deleted",
          "row": 5,
          "text": "deny if input.blocked"
        }
      ],
      "path": "authz/policy.rego",
      "removed": false,
      "shaken": "package authz\n\nallow if input.user == \"admin\"\n"
    },
    {
      "addedLines": 0,
      "deletedLines": 2,
      "keptLines": 0,
      "lines": [
        {
          "change": "deleted",
          "row": 1,
          "text": "package lib.time"
        },
        {
          "change": "deleted",
          "row": 2,
          "text": "weekend := false"
        }
      ],
      "path": "lib/time.rego",
      "removed": true
    }
  ],
  "removedFiles": [
    "lib/time.rego"
  ]
}

400 Bad Request

application/json object

  • code: string
  • message: string
{
  "code": "invalid_parameter",
  "message": "the bundle has no rules and no data at the entrypoint authz/nothing"
}

404 Not Found

application/json object

  • code: string
  • message: string
{
  "code": "resource_not_found",
  "message": "the server has no bundle payroll"
}

POST /bundles/{name}/v1/signed/data

Evaluate the document at the path, with the input, and sign the decision

The response is a DSSE envelope with an in-toto Statement v1 about the decision. It names the principal of the caller. A signed decision needs an input. The server does not sign the decision of a query that called an impure builtin.

Parameters

NameInTypeRequiredDescription
namepathstringyesThe name of a bundle, for example billing

Request body

application/json object

  • input: object
    • user: string
{
  "input": {
    "user": "alice"
  }
}

Responses

200 OK

application/json object

  • payload: string
  • payloadType: string
  • signatures: array of object
    • keyid: string
    • sig: string
    • x5c: array of string
{
  "payload": "eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF0ZW1lbnQvdjEi...",
  "payloadType": "application/vnd.in-toto+json",
  "signatures": [
    {
      "keyid": "decisions-2026",
      "sig": "MEUCIQD...",
      "x5c": [
        "MIIBszCCAVmgAwIBAgI...",
        "MIIBjDCCATKgAwIBAgI..."
      ]
    }
  ]
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

POST /bundles/{name}/v1/signed/data/{path}

Evaluate the document at the path, with the input, and sign the decision

The response is a DSSE envelope with an in-toto Statement v1 about the decision. It names the principal of the caller. A signed decision needs an input. The server does not sign the decision of a query that called an impure builtin.

Parameters

NameInTypeRequiredDescription
namepathstringyesThe name of a bundle, for example billing
pathpathstringyesThe path of the document in data, with / between its parts, for example authz/allow

Request body

application/json object

  • input: object
    • user: string
{
  "input": {
    "user": "alice"
  }
}

Responses

200 OK

application/json object

  • payload: string
  • payloadType: string
  • signatures: array of object
    • keyid: string
    • sig: string
    • x5c: array of string
{
  "payload": "eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF0ZW1lbnQvdjEi...",
  "payloadType": "application/vnd.in-toto+json",
  "signatures": [
    {
      "keyid": "decisions-2026",
      "sig": "MEUCIQD...",
      "x5c": [
        "MIIBszCCAVmgAwIBAgI...",
        "MIIBjDCCATKgAwIBAgI..."
      ]
    }
  ]
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

GET /health

The health of the server: {}

rego4k reads each bundle before it serves, so the server is always healthy. It accepts the parameters of OPA.

Parameters

NameInTypeRequiredDescription
bundlesqueryarray of booleannoOPA checks that each bundle is active. rego4k reads each bundle before it serves
pluginsqueryarray of booleannoOPA checks that each plugin is OK. rego4k has no plugins
exclude-pluginqueryarray of stringnoA plugin that the check of the plugins ignores

Responses

200 OK

application/json object

{}

GET /v1/data

Evaluate the document at the path, with the input of the parameter input

As OPA's Data API. The response is {} if the document is undefined. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
inputqueryarray of stringnoThe input document, as JSON text
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
provenancequeryarray of booleannoIf true, the response has the version of rego4k and the revision of each bundle

Responses

200 OK

application/json object

  • result: boolean
{
  "result": true
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

POST /v1/data

Evaluate the document at the path, with the input of the body

As OPA's Data API. The response is {} if the document is undefined. With no input, it has a warning. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
provenancequeryarray of booleannoIf true, the response has the version of rego4k and the revision of each bundle

Request body

application/json object

  • input: object
    • user: string
{
  "input": {
    "user": "alice"
  }
}

Responses

200 OK

application/json object

  • result: boolean
{
  "result": true
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

GET /v1/data/{path}

Evaluate the document at the path, with the input of the parameter input

As OPA's Data API. The response is {} if the document is undefined. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
inputqueryarray of stringnoThe input document, as JSON text
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
provenancequeryarray of booleannoIf true, the response has the version of rego4k and the revision of each bundle
pathpathstringyesThe path of the document in data, with / between its parts, for example authz/allow

Responses

200 OK

application/json object

  • result: boolean
{
  "result": true
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

POST /v1/data/{path}

Evaluate the document at the path, with the input of the body

As OPA's Data API. The response is {} if the document is undefined. With no input, it has a warning. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision
provenancequeryarray of booleannoIf true, the response has the version of rego4k and the revision of each bundle
pathpathstringyesThe path of the document in data, with / between its parts, for example authz/allow

Request body

application/json object

  • input: object
    • user: string
{
  "input": {
    "user": "alice"
  }
}

Responses

200 OK

application/json object

  • result: boolean
{
  "result": true
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

GET /v1/policies

The modules of the bundle

As OPA's Policy API. The ID of a module is the name of the bundle and the path of the module. OPA also gives the AST.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented

Responses

200 OK

application/json object

  • result: array of object
    • id: string
    • raw: string
{
  "result": [
    {
      "id": "default/authz/policy.rego",
      "raw": "package authz\n\nallow if input.user == \"alice\"\n"
    }
  ]
}

DELETE /v1/policies/{id}

Refused: a bundle owns all the paths

As OPA with a bundle: a delete of a module gets 400, and a delete of a module that does not exist gets 404.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
idpathstringyesThe ID of a policy module: the name of the bundle, then the path of the module in the bundle

Responses

400 Bad Request

application/json object

  • code: string
  • message: string
{
  "code": "invalid_parameter",
  "message": "all paths owned by bundle \"default\""
}

404 Not Found

application/json object

  • code: string
  • message: string
{
  "code": "resource_not_found",
  "message": "storage_not_found_error: policy id \"default/x.rego\""
}

GET /v1/policies/{id}

A module of the bundle

As OPA's Policy API. The ID is the name of the bundle and the path of the module, for example default/authz/policy.rego.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
idpathstringyesThe ID of a policy module: the name of the bundle, then the path of the module in the bundle

Responses

200 OK

application/json object

  • result: object
    • id: string
    • raw: string
{
  "result": {
    "id": "default/authz/policy.rego",
    "raw": "package authz\n\nallow if input.user == \"alice\"\n"
  }
}

404 Not Found

application/json object

  • code: string
  • message: string
{
  "code": "resource_not_found",
  "message": "storage_not_found_error: policy id \"default/x.rego\""
}

PUT /v1/policies/{id}

Refused: a bundle owns all the paths

As OPA with a bundle: each write gets 400.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
idpathstringyesThe ID of a policy module: the name of the bundle, then the path of the module in the bundle

Responses

400 Bad Request

application/json object

  • code: string
  • message: string
{
  "code": "invalid_parameter",
  "message": "all paths owned by bundle \"default\""
}

GET /v1/query

Evaluate the Rego query of the parameter q

As OPA's Query API. The query has no input. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
qqueryarray of stringnoThe Rego query
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision

Responses

200 OK

application/json object

  • result: array of object
    • x: string
{
  "result": [
    {
      "x": "alice"
    }
  ]
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

POST /v1/query

Evaluate a Rego query, with the input

As OPA's Query API. The result has the bindings of the vars of each solution, or it is {} if there is none. With provided=true, the response also has provided: the provided values that the query read, in the form of a signed decision, for example {"result": true, "provided": {"time": "2026-12-01T10:00:00Z", "zoneData": "2026e"}}.

Parameters

NameInTypeRequiredDescription
prettyqueryarray of booleannoIf true, the JSON of the response is indented
explainqueryarray of stringnoThe explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation
metricsqueryarray of booleannoIf true, the response has the timers of the evaluation in metrics
instrumentqueryarray of booleannoIf true, the response has the metrics. rego4k gives no more metrics than with metrics=true
strict-builtin-errorsqueryarray of booleannoIf true, an error of a builtin stops the evaluation with 500, and is not undefined
providedqueryarray of booleannoIf true, the response also has the provided values that the query read, in the form of a signed decision

Request body

application/json object

  • input: object
    • user: string
  • query: string
{
  "input": {
    "user": "alice"
  },
  "query": "x := input.user"
}

Responses

200 OK

application/json object

  • result: array of object
    • x: string
{
  "result": [
    {
      "x": "alice"
    }
  ]
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

GET /v1/shaking

Show what tree shaking does to each file of the bundle, for the entrypoints, without a change to the bundle

For each module and data file: the lines that the shaken bundle keeps, deletes and adds, and the shaken text. A removed file has no shaken text. The response also has the builtins that the shaken bundle needs, and the numbers of lines and files.

Parameters

NameInTypeRequiredDescription
entrypointqueryarray of stringyesAn entrypoint, in the form of opa build -e, for example authz/allow. Give the parameter one time for each entrypoint

Responses

200 OK

application/json object

  • builtins: array of string
  • bundle: string
  • counts: object
    • addedLines: integer
    • deletedLines: integer
    • keptFiles: integer
    • keptLines: integer
    • removedFiles: integer
  • entrypoints: array of string
  • files: array of object
    • addedLines: integer
    • deletedLines: integer
    • keptLines: integer
    • lines: array of object
      • change: string
      • row: integer
      • shakenRow: integer
      • text: string
    • path: string
    • removed: boolean
    • shaken: string
  • removedFiles: array of string
{
  "builtins": [
    "equal"
  ],
  "bundle": "default",
  "counts": {
    "addedLines": 0,
    "deletedLines": 4,
    "keptFiles": 1,
    "keptLines": 3,
    "removedFiles": 1
  },
  "entrypoints": [
    "authz/allow"
  ],
  "files": [
    {
      "addedLines": 0,
      "deletedLines": 2,
      "keptLines": 3,
      "lines": [
        {
          "change": "kept",
          "row": 1,
          "shakenRow": 1,
          "text": "package authz"
        },
        {
          "change": "kept",
          "row": 2,
          "shakenRow": 2,
          "text": ""
        },
        {
          "change": "kept",
          "row": 3,
          "shakenRow": 3,
          "text": "allow if input.user == \"admin\""
        },
        {
          "change": "deleted",
          "row": 4,
          "text": ""
        },
        {
          "change": "deleted",
          "row": 5,
          "text": "deny if input.blocked"
        }
      ],
      "path": "authz/policy.rego",
      "removed": false,
      "shaken": "package authz\n\nallow if input.user == \"admin\"\n"
    },
    {
      "addedLines": 0,
      "deletedLines": 2,
      "keptLines": 0,
      "lines": [
        {
          "change": "deleted",
          "row": 1,
          "text": "package lib.time"
        },
        {
          "change": "deleted",
          "row": 2,
          "text": "weekend := false"
        }
      ],
      "path": "lib/time.rego",
      "removed": true
    }
  ],
  "removedFiles": [
    "lib/time.rego"
  ]
}

400 Bad Request

application/json object

  • code: string
  • message: string
{
  "code": "invalid_parameter",
  "message": "the bundle has no rules and no data at the entrypoint authz/nothing"
}

404 Not Found

application/json object

  • code: string
  • message: string
{
  "code": "resource_not_found",
  "message": "the server has no bundle payroll"
}

POST /v1/signed/data

Evaluate the document at the path, with the input, and sign the decision

The response is a DSSE envelope with an in-toto Statement v1 about the decision. It names the principal of the caller. A signed decision needs an input. The server does not sign the decision of a query that called an impure builtin.

Request body

application/json object

  • input: object
    • user: string
{
  "input": {
    "user": "alice"
  }
}

Responses

200 OK

application/json object

  • payload: string
  • payloadType: string
  • signatures: array of object
    • keyid: string
    • sig: string
    • x5c: array of string
{
  "payload": "eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF0ZW1lbnQvdjEi...",
  "payloadType": "application/vnd.in-toto+json",
  "signatures": [
    {
      "keyid": "decisions-2026",
      "sig": "MEUCIQD...",
      "x5c": [
        "MIIBszCCAVmgAwIBAgI...",
        "MIIBjDCCATKgAwIBAgI..."
      ]
    }
  ]
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

POST /v1/signed/data/{path}

Evaluate the document at the path, with the input, and sign the decision

The response is a DSSE envelope with an in-toto Statement v1 about the decision. It names the principal of the caller. A signed decision needs an input. The server does not sign the decision of a query that called an impure builtin.

Parameters

NameInTypeRequiredDescription
pathpathstringyesThe path of the document in data, with / between its parts, for example authz/allow

Request body

application/json object

  • input: object
    • user: string
{
  "input": {
    "user": "alice"
  }
}

Responses

200 OK

application/json object

  • payload: string
  • payloadType: string
  • signatures: array of object
    • keyid: string
    • sig: string
    • x5c: array of string
{
  "payload": "eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF0ZW1lbnQvdjEi...",
  "payloadType": "application/vnd.in-toto+json",
  "signatures": [
    {
      "keyid": "decisions-2026",
      "sig": "MEUCIQD...",
      "x5c": [
        "MIIBszCCAVmgAwIBAgI...",
        "MIIBjDCCATKgAwIBAgI..."
      ]
    }
  ]
}

400 Bad Request

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "invalid_parameter",
  "errors": [
    {
      "code": "rego_parse_error",
      "location": {
        "col": 6,
        "file": "",
        "row": 1
      },
      "message": "unexpected eof token"
    }
  ],
  "message": "error(s) occurred while parsing query"
}

500 Internal Server Error

application/json object

  • code: string
  • errors: array of object
    • code: string
    • location: object
      • col: integer
      • file: string
      • row: integer
    • message: string
  • message: string
{
  "code": "internal_error",
  "errors": [
    {
      "code": "eval_conflict_error",
      "location": {
        "col": 1,
        "file": "authz/policy.rego",
        "row": 8
      },
      "message": "rule data.authz.conflict produced conflicting values:\n  1 at authz/policy.rego:7\n  2 at authz/policy.rego:8"
    }
  ],
  "message": "error(s) occurred while evaluating query"
}

rego4k debugger version 1

The actions of the page of the debugger, with Datastar signals and events

The JSON of this description: /debugger/openapi.json

POST /api/breakpoints/{row}

Set or remove a breakpoint on a line of the source of the tab

Parameters

NameInTypeRequiredDescription
rowpathintegeryesThe line in the source of the tab, from 1

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/bundles/{name}

Open a bundle of the catalog: its files, the package of its first module as the query, and its first example input

Parameters

NameInTypeRequiredDescription
namepathstringyesThe name of a bundle of the catalog

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/commands/{command}

Start a replay, or continue it to the next step of the command

Parameters

NameInTypeRequiredDescription
commandpathstringyesThe command: start, step_into, step_over, step_out, step_back, continue, show

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/edit

End the replay, and show the editors

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/examples/{index}

Copy an example input of the files into the input

Parameters

NameInTypeRequiredDescription
indexpathintegeryesThe index of an example input of the files

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/files/add

Add a module

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/files/remove

Remove the file of the editors

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/focus/{index}

Focus a file, or the query

Parameters

NameInTypeRequiredDescription
indexpathintegeryesThe index of a file, or -1 for the query

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/folders/{index}

Open or close a folder of the explorer

Parameters

NameInTypeRequiredDescription
indexpathintegeryesThe index of a folder of the explorer, in the order of the paths of the folders

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/format

Format the JSON documents of the editors and the files, if they parse

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/generated-vars

Show the vars that the compiler made in the bindings, or hide them

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/steps/{step}

Show a step of the replay, for example the step of a line of the trace

Parameters

NameInTypeRequiredDescription
steppathintegeryesThe number of a step of the replay, from 1

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any

POST /api/texts/{field}

Mark the parse errors of the text of an editor. The response patches only the errors

Parameters

NameInTypeRequiredDescription
fieldpathstringyesThe field: query, editor, input

Request body

application/json object

  • breakpoints: array of object
    • file: string
    • row: integer
  • bundle: string
  • closed: array of array of string
  • editor: string
  • fileName: string
  • files: array of object
    • name: string
    • text: string
  • focus: integer
  • generatedVars: boolean
  • input: string
  • query: string
  • recorded: string
  • step: integer
  • views: object
{
  "breakpoints": [
    {
      "file": "policy.rego",
      "row": 7
    }
  ],
  "bundle": "",
  "closed": [
    [
      "app"
    ]
  ],
  "editor": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n",
  "fileName": "policy.rego",
  "files": [
    {
      "name": "policy.rego",
      "text": "package app\n\ndefault allow := false\n\nallow if {\n\tsome role in input.user.roles\n\trole in data.admins\n}\n\ndeny contains msg if {\n\tsome item in input.items\n\titem.price > 100\n\tmsg := sprintf(\"item %s costs too much\", [item.id])\n}\n"
    },
    {
      "name": "data.json",
      "text": "{\n  \"admins\": [\n    \"admin\"\n  ]\n}"
    }
  ],
  "focus": 0,
  "generatedVars": false,
  "input": "{\n  \"items\": [\n    {\n      \"id\": \"a\",\n      \"price\": 5\n    },\n    {\n      \"id\": \"b\",\n      \"price\": 500\n    }\n  ],\n  \"user\": {\n    \"roles\": [\n      \"dev\",\n      \"admin\"\n    ]\n  }\n}",
  "query": "data.app",
  "recorded": "",
  "step": 0,
  "views": {}
}

Responses

200 OK

text/event-stream any