rego4k server version 1
The routes of the modules docs, policies, signing, debugger, shaking
The JSON of this description: /openapi.json
- GET
/bundlesThe bundles of the server, with the revision and the hash of each bundle - GET
/bundles/{name}/v1/dataEvaluate the document at the path, with the input of the parameter input - POST
/bundles/{name}/v1/dataEvaluate the document at the path, with the input of the body - GET
/bundles/{name}/v1/data/{path}Evaluate the document at the path, with the input of the parameter input - POST
/bundles/{name}/v1/data/{path}Evaluate the document at the path, with the input of the body - GET
/bundles/{name}/v1/policiesThe modules of the bundle - DELETE
/bundles/{name}/v1/policies/{id}Refused: a bundle owns all the paths - GET
/bundles/{name}/v1/policies/{id}A module of the bundle - PUT
/bundles/{name}/v1/policies/{id}Refused: a bundle owns all the paths - GET
/bundles/{name}/v1/queryEvaluate the Rego query of the parameter q - POST
/bundles/{name}/v1/queryEvaluate a Rego query, with the input - GET
/bundles/{name}/v1/shakingShow what tree shaking does to each file of the bundle, for the entrypoints, without a change to the bundle - POST
/bundles/{name}/v1/signed/dataEvaluate the document at the path, with the input, and sign the decision - POST
/bundles/{name}/v1/signed/data/{path}Evaluate the document at the path, with the input, and sign the decision - GET
/healthThe health of the server: {} - GET
/v1/dataEvaluate the document at the path, with the input of the parameter input - POST
/v1/dataEvaluate the document at the path, with the input of the body - GET
/v1/data/{path}Evaluate the document at the path, with the input of the parameter input - POST
/v1/data/{path}Evaluate the document at the path, with the input of the body - GET
/v1/policiesThe modules of the bundle - DELETE
/v1/policies/{id}Refused: a bundle owns all the paths - GET
/v1/policies/{id}A module of the bundle - PUT
/v1/policies/{id}Refused: a bundle owns all the paths - GET
/v1/queryEvaluate the Rego query of the parameter q - POST
/v1/queryEvaluate a Rego query, with the input - GET
/v1/shakingShow what tree shaking does to each file of the bundle, for the entrypoints, without a change to the bundle - POST
/v1/signed/dataEvaluate the document at the path, with the input, and sign the decision - POST
/v1/signed/data/{path}Evaluate the document at the path, with the input, and sign the decision
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 objectname:stringrevision:stringsha256: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
input | query | array of string | no | The input document, as JSON text |
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
provenance | query | array of boolean | no | If true, the response has the version of rego4k and the revision of each bundle |
name | path | string | yes | The name of a bundle, for example billing |
Responses
200 OK
application/json object
result:boolean
{
"result": true
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
provenance | query | array of boolean | no | If true, the response has the version of rego4k and the revision of each bundle |
name | path | string | yes | The name of a bundle, for example billing |
Request body
application/json object
input:objectuser:string
{
"input": {
"user": "alice"
}
}Responses
200 OK
application/json object
result:boolean
{
"result": true
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
input | query | array of string | no | The input document, as JSON text |
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
provenance | query | array of boolean | no | If true, the response has the version of rego4k and the revision of each bundle |
name | path | string | yes | The name of a bundle, for example billing |
path | path | string | yes | The 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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
provenance | query | array of boolean | no | If true, the response has the version of rego4k and the revision of each bundle |
name | path | string | yes | The name of a bundle, for example billing |
path | path | string | yes | The path of the document in data, with / between its parts, for example authz/allow |
Request body
application/json object
input:objectuser:string
{
"input": {
"user": "alice"
}
}Responses
200 OK
application/json object
result:boolean
{
"result": true
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
name | path | string | yes | The name of a bundle, for example billing |
Responses
200 OK
application/json object
result:array of objectid:stringraw: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
name | path | string | yes | The name of a bundle, for example billing |
id | path | string | yes | The 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:stringmessage:string
{
"code": "invalid_parameter",
"message": "all paths owned by bundle \"default\""
}404 Not Found
application/json object
code:stringmessage: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
name | path | string | yes | The name of a bundle, for example billing |
id | path | string | yes | The 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:objectid:stringraw:string
{
"result": {
"id": "default/authz/policy.rego",
"raw": "package authz\n\nallow if input.user == \"alice\"\n"
}
}404 Not Found
application/json object
code:stringmessage: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
name | path | string | yes | The name of a bundle, for example billing |
id | path | string | yes | The 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:stringmessage: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
q | query | array of string | no | The Rego query |
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
name | path | string | yes | The name of a bundle, for example billing |
Responses
200 OK
application/json object
result:array of objectx:string
{
"result": [
{
"x": "alice"
}
]
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
name | path | string | yes | The name of a bundle, for example billing |
Request body
application/json object
input:objectuser:string
query:string
{
"input": {
"user": "alice"
},
"query": "x := input.user"
}Responses
200 OK
application/json object
result:array of objectx:string
{
"result": [
{
"x": "alice"
}
]
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
entrypoint | query | array of string | yes | An entrypoint, in the form of opa build -e, for example authz/allow. Give the parameter one time for each entrypoint |
name | path | string | yes | The name of a bundle, for example billing |
Responses
200 OK
application/json object
builtins:array of stringbundle:stringcounts:objectaddedLines:integerdeletedLines:integerkeptFiles:integerkeptLines:integerremovedFiles:integer
entrypoints:array of stringfiles:array of objectaddedLines:integerdeletedLines:integerkeptLines:integerlines:array of objectchange:stringrow:integershakenRow:integertext:string
path:stringremoved:booleanshaken: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:stringmessage: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:stringmessage: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | The name of a bundle, for example billing |
Request body
application/json object
input:objectuser:string
{
"input": {
"user": "alice"
}
}Responses
200 OK
application/json object
payload:stringpayloadType:stringsignatures:array of objectkeyid:stringsig:stringx5c: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | The name of a bundle, for example billing |
path | path | string | yes | The path of the document in data, with / between its parts, for example authz/allow |
Request body
application/json object
input:objectuser:string
{
"input": {
"user": "alice"
}
}Responses
200 OK
application/json object
payload:stringpayloadType:stringsignatures:array of objectkeyid:stringsig:stringx5c: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
bundles | query | array of boolean | no | OPA checks that each bundle is active. rego4k reads each bundle before it serves |
plugins | query | array of boolean | no | OPA checks that each plugin is OK. rego4k has no plugins |
exclude-plugin | query | array of string | no | A 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
input | query | array of string | no | The input document, as JSON text |
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
provenance | query | array of boolean | no | If 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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
provenance | query | array of boolean | no | If true, the response has the version of rego4k and the revision of each bundle |
Request body
application/json object
input:objectuser:string
{
"input": {
"user": "alice"
}
}Responses
200 OK
application/json object
result:boolean
{
"result": true
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
input | query | array of string | no | The input document, as JSON text |
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
provenance | query | array of boolean | no | If true, the response has the version of rego4k and the revision of each bundle |
path | path | string | yes | The 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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If true, the response also has the provided values that the query read, in the form of a signed decision |
provenance | query | array of boolean | no | If true, the response has the version of rego4k and the revision of each bundle |
path | path | string | yes | The path of the document in data, with / between its parts, for example authz/allow |
Request body
application/json object
input:objectuser:string
{
"input": {
"user": "alice"
}
}Responses
200 OK
application/json object
result:boolean
{
"result": true
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
Responses
200 OK
application/json object
result:array of objectid:stringraw: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
id | path | string | yes | The 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:stringmessage:string
{
"code": "invalid_parameter",
"message": "all paths owned by bundle \"default\""
}404 Not Found
application/json object
code:stringmessage: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
id | path | string | yes | The 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:objectid:stringraw:string
{
"result": {
"id": "default/authz/policy.rego",
"raw": "package authz\n\nallow if input.user == \"alice\"\n"
}
}404 Not Found
application/json object
code:stringmessage: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
id | path | string | yes | The 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:stringmessage: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
q | query | array of string | no | The Rego query |
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If 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 objectx:string
{
"result": [
{
"x": "alice"
}
]
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pretty | query | array of boolean | no | If true, the JSON of the response is indented |
explain | query | array of string | no | The explanation of the evaluation in the response: full, notes, fails or debug. Another value gives no explanation |
metrics | query | array of boolean | no | If true, the response has the timers of the evaluation in metrics |
instrument | query | array of boolean | no | If true, the response has the metrics. rego4k gives no more metrics than with metrics=true |
strict-builtin-errors | query | array of boolean | no | If true, an error of a builtin stops the evaluation with 500, and is not undefined |
provided | query | array of boolean | no | If 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:objectuser:string
query:string
{
"input": {
"user": "alice"
},
"query": "x := input.user"
}Responses
200 OK
application/json object
result:array of objectx:string
{
"result": [
{
"x": "alice"
}
]
}400 Bad Request
application/json object
code:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
entrypoint | query | array of string | yes | An 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 stringbundle:stringcounts:objectaddedLines:integerdeletedLines:integerkeptFiles:integerkeptLines:integerremovedFiles:integer
entrypoints:array of stringfiles:array of objectaddedLines:integerdeletedLines:integerkeptLines:integerlines:array of objectchange:stringrow:integershakenRow:integertext:string
path:stringremoved:booleanshaken: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:stringmessage: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:stringmessage: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:objectuser:string
{
"input": {
"user": "alice"
}
}Responses
200 OK
application/json object
payload:stringpayloadType:stringsignatures:array of objectkeyid:stringsig:stringx5c: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | yes | The path of the document in data, with / between its parts, for example authz/allow |
Request body
application/json object
input:objectuser:string
{
"input": {
"user": "alice"
}
}Responses
200 OK
application/json object
payload:stringpayloadType:stringsignatures:array of objectkeyid:stringsig:stringx5c: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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:stringerrors:array of objectcode:stringlocation:objectcol:integerfile:stringrow: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 - 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 - POST
/api/commands/{command}Start a replay, or continue it to the next step of the command - POST
/api/editEnd the replay, and show the editors - POST
/api/examples/{index}Copy an example input of the files into the input - POST
/api/files/addAdd a module - POST
/api/files/removeRemove the file of the editors - POST
/api/focus/{index}Focus a file, or the query - POST
/api/folders/{index}Open or close a folder of the explorer - POST
/api/formatFormat the JSON documents of the editors and the files, if they parse - POST
/api/generated-varsShow the vars that the compiler made in the bindings, or hide them - POST
/api/steps/{step}Show a step of the replay, for example the step of a line of the trace - POST
/api/texts/{field}Mark the parse errors of the text of an editor. The response patches only the errors
POST /api/breakpoints/{row}
Set or remove a breakpoint on a line of the source of the tab
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
row | path | integer | yes | The line in the source of the tab, from 1 |
Request body
application/json object
breakpoints:array of objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | The name of a bundle of the catalog |
Request body
application/json object
breakpoints:array of objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
command | path | string | yes | The command: start, step_into, step_over, step_out, step_back, continue, show |
Request body
application/json object
breakpoints:array of objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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 objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
index | path | integer | yes | The index of an example input of the files |
Request body
application/json object
breakpoints:array of objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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 objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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 objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
index | path | integer | yes | The index of a file, or -1 for the query |
Request body
application/json object
breakpoints:array of objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
index | path | integer | yes | The index of a folder of the explorer, in the order of the paths of the folders |
Request body
application/json object
breakpoints:array of objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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 objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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 objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
step | path | integer | yes | The number of a step of the replay, from 1 |
Request body
application/json object
breakpoints:array of objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
field | path | string | yes | The field: query, editor, input |
Request body
application/json object
breakpoints:array of objectfile:stringrow:integer
bundle:stringclosed:array of array of stringeditor:stringfileName:stringfiles:array of objectname:stringtext:string
focus:integergeneratedVars:booleaninput:stringquery:stringrecorded:stringstep:integerviews: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