many-dawn-19625
06/12/2025, 2:40 AMbrief-egg-61061
06/12/2025, 2:40 AMbrief-egg-61061
06/12/2025, 2:40 AMPOST /opl/syntax/check
- The OPL file content should be sent as plain text in the request body. - The response will include any syntax errors found in the OPL file, including their location and error message. Example request: http POST /opl/syntax/check Content-Type: text/plain import { Namespace, Context } from "@ory/keto-namespace-types" class User implements Namespace {} class Document implements Namespace { related: { editors: User[] viewers: User[] } permits = { write: (ctx: Context): boolean => this.related.editors.includes(ctx.subject), read: (ctx: Context): boolean => this.permits.write(ctx) || this.related.viewers.includes(ctx.subject), } }
Example response (if there are no syntax errors): json { "errors": [] }
Example response (if there are syntax errors): json { "errors": [ { "message": "Unexpected token", "start": { "Line": 5, "column": 10 }, "end": { "Line": 5, "column": 11 } } ] }
Note: The endpoint is /opl/syntax/check
, not /admin/relation-tuples
. There is no information in the knowledge sources about a POST /admin/relation-tuples
endpoint for checking OPL syntax. The correct endpoint for OPL syntax checking is as described above [Ory API Reference](https://www.ory.sh/docs/reference/api) [Ory Keto REST API Reference](https://www.ory.sh/docs/keto/reference/rest-api).many-dawn-19625
06/12/2025, 2:52 AM