{ "components": { "responses": { "emptyResponse": { "description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201." } }, "schemas": { "ParseError": { "properties": { "end": { "$ref": "#/components/schemas/SourcePosition" }, "message": { "type": "string" }, "start": { "$ref": "#/components/schemas/SourcePosition" } }, "type": "object" }, "SourcePosition": { "properties": { "Line": { "format": "int64", "type": "integer" }, "column": { "format": "int64", "type": "integer" } }, "type": "object" }, "UUID": { "format": "uuid4", "type": "string" }, "expandTree": { "properties": { "children": { "description": "The children of the node, possibly none.", "items": { "$ref": "#/components/schemas/expandTree" }, "type": "array" }, "tuple": { "$ref": "#/components/schemas/relationTuple" }, "type": { "description": "The type of the node.\nunion TreeNodeUnion\nexclusion TreeNodeExclusion\nintersection TreeNodeIntersection\nleaf TreeNodeLeaf\ntuple_to_subject_set TreeNodeTupleToSubjectSet\ncomputed_subject_set TreeNodeComputedSubjectSet\nnot TreeNodeNot\nunspecified TreeNodeUnspecified", "enum": [ "union", "exclusion", "intersection", "leaf", "tuple_to_subject_set", "computed_subject_set", "not", "unspecified" ], "type": "string", "x-go-enum-desc": "union TreeNodeUnion\nexclusion TreeNodeExclusion\nintersection TreeNodeIntersection\nleaf TreeNodeLeaf\ntuple_to_subject_set TreeNodeTupleToSubjectSet\ncomputed_subject_set TreeNodeComputedSubjectSet\nnot TreeNodeNot\nunspecified TreeNodeUnspecified" } }, "required": ["type"], "type": "object" }, "genericError": { "description": "The standard error format", "properties": { "code": { "format": "int64", "type": "integer" }, "details": { "items": { "additionalProperties": {}, "type": "object" }, "type": "array" }, "message": { "type": "string" }, "reason": { "type": "string" }, "request": { "type": "string" }, "status": { "type": "string" } }, "type": "object" }, "getCheckResponse": { "description": "The content of the allowed field is mirrored in the HTTP status code.", "properties": { "allowed": { "description": "whether the relation tuple is allowed", "type": "boolean" } }, "required": ["allowed"], "title": "RESTResponse represents the response for a check request.", "type": "object" }, "getRelationTuplesResponse": { "properties": { "next_page_token": { "description": "The opaque token to provide in a subsequent request\nto get the next page. It is the empty string iff this is\nthe last page.", "type": "string" }, "relation_tuples": { "items": { "$ref": "#/components/schemas/relationTuple" }, "type": "array" } }, "type": "object" }, "healthNotReadyStatus": { "properties": { "errors": { "additionalProperties": { "type": "string" }, "description": "Errors contains a list of errors that caused the not ready status.", "type": "object" } }, "type": "object" }, "healthStatus": { "properties": { "status": { "description": "Status always contains \"ok\".", "type": "string" } }, "type": "object" }, "patchDelta": { "properties": { "action": { "enum": ["insert", "delete"], "type": "string", "x-go-enum-desc": "insert ActionInsert\ndelete ActionDelete" }, "relation_tuple": { "$ref": "#/components/schemas/relationTuple" } }, "type": "object" }, "postCheckOplSyntaxResponse": { "properties": { "errors": { "description": "The list of syntax errors", "items": { "$ref": "#/components/schemas/ParseError" }, "type": "array" } }, "title": "CheckOPLSyntaxResponse represents the response for an OPL syntax check request.", "type": "object" }, "relationQuery": { "properties": { "namespace": { "description": "Namespace to query", "type": "string" }, "object": { "description": "Object to query", "type": "string" }, "relation": { "description": "Relation to query", "type": "string" }, "subject_id": { "description": "SubjectID to query\n\nEither SubjectSet or SubjectID can be provided.", "type": "string" }, "subject_set": { "$ref": "#/components/schemas/subjectSet" } }, "type": "object" }, "relationTuple": { "properties": { "namespace": { "description": "Namespace of the Relation Tuple", "type": "string" }, "object": { "description": "Object of the Relation Tuple", "type": "string" }, "relation": { "description": "Relation of the Relation Tuple", "type": "string" }, "subject_id": { "description": "SubjectID of the Relation Tuple\n\nEither SubjectSet or SubjectID can be provided.", "type": "string" }, "subject_set": { "$ref": "#/components/schemas/subjectSet" } }, "required": ["namespace", "object", "relation"], "type": "object" }, "subjectSet": { "properties": { "namespace": { "description": "Namespace of the Subject Set", "type": "string" }, "object": { "description": "Object of the Subject Set", "type": "string" }, "relation": { "description": "Relation of the Subject Set", "type": "string" } }, "required": ["namespace", "object", "relation"], "type": "object" }, "version": { "properties": { "version": { "description": "Version is the service's version.", "type": "string" } }, "type": "object" } } }, "info": { "contact": { "email": "hi@ory.sh" }, "description": "Documentation for all of Ory Keto's REST APIs. gRPC is documented separately.\n", "license": { "name": "Apache 2.0" }, "title": "Ory Keto API", "version": "" }, "openapi": "3.0.3", "paths": { "/admin/relation-tuples": { "delete": { "description": "Use this endpoint to delete relation tuples", "operationId": "deleteRelationTuples", "parameters": [ { "description": "Namespace of the Relation Tuple", "in": "query", "name": "namespace", "schema": { "type": "string" } }, { "description": "Object of the Relation Tuple", "in": "query", "name": "object", "schema": { "type": "string" } }, { "description": "Relation of the Relation Tuple", "in": "query", "name": "relation", "schema": { "type": "string" } }, { "description": "SubjectID of the Relation Tuple", "in": "query", "name": "subject_id", "schema": { "type": "string" } }, { "description": "Namespace of the Subject Set", "in": "query", "name": "subject_set.namespace", "schema": { "type": "string" } }, { "description": "Object of the Subject Set", "in": "query", "name": "subject_set.object", "schema": { "type": "string" } }, { "description": "Relation of the Subject Set", "in": "query", "name": "subject_set.relation", "schema": { "type": "string" } } ], "responses": { "204": { "$ref": "#/components/responses/emptyResponse" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Delete Relation Tuples", "tags": ["write"] }, "patch": { "description": "Use this endpoint to patch one or more relation tuples.", "operationId": "patchRelationTuples", "requestBody": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/patchDelta" }, "type": "array" } } }, "x-originalParamName": "Payload" }, "responses": { "204": { "$ref": "#/components/responses/emptyResponse" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Patch Multiple Relation Tuples", "tags": ["write"] }, "put": { "description": "Use this endpoint to create a relation tuple.", "operationId": "createRelationTuple", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/relationQuery" } } }, "x-originalParamName": "Payload" }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/relationQuery" } } }, "description": "relationQuery" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Create a Relation Tuple", "tags": ["write"] } }, "/health/alive": { "get": { "description": "This endpoint returns a HTTP 200 status code when Ory Keto is accepting incoming\nHTTP requests. This status does currently not include checks whether the database connection is working.\n\nIf the service supports TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto` header to be set.\n\nBe aware that if you are running multiple nodes of this service, the health status will never\nrefer to the cluster state, only to a single instance.", "operationId": "isAlive", "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "status": { "description": "Always \"ok\".", "type": "string" } }, "required": ["status"], "type": "object" } } }, "description": "Ory Keto is ready to accept connections." }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Check HTTP Server Status", "tags": ["metadata"] } }, "/health/ready": { "get": { "description": "This endpoint returns a HTTP 200 status code when Ory Keto is up running and the environment dependencies (e.g.\nthe database) are responsive as well.\n\nIf the service supports TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto` header to be set.\n\nBe aware that if you are running multiple nodes of Ory Keto, the health status will never\nrefer to the cluster state, only to a single instance.", "operationId": "isReady", "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "status": { "description": "Always \"ok\".", "type": "string" } }, "required": ["status"], "type": "object" } } }, "description": "Ory Keto is ready to accept requests." }, "503": { "content": { "application/json": { "schema": { "properties": { "errors": { "additionalProperties": { "type": "string" }, "description": "Errors contains a list of errors that caused the not ready status.", "type": "object" } }, "required": ["errors"], "type": "object" } } }, "description": "Ory Kratos is not yet ready to accept requests." } }, "summary": "Check HTTP Server and Database Status", "tags": ["metadata"] } }, "/opl/syntax/check": { "post": { "description": "The OPL file is expected in the body of the request.", "operationId": "postCheckOplSyntax", "requestBody": { "content": { "text/plain": { "schema": { "description": "the OPL content to check", "type": "string" } } }, "description": "the OPL content to check", "required": true, "x-originalParamName": "content" }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/postCheckOplSyntaxResponse" } } }, "description": "postCheckOplSyntaxResponse" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Check the syntax of an OPL file", "tags": ["syntax"] } }, "/relation-tuples": { "get": { "description": "Get all relation tuples that match the query. Only the namespace field is required.", "operationId": "getRelationTuples", "parameters": [ { "in": "query", "name": "page_token", "schema": { "type": "string" } }, { "in": "query", "name": "page_size", "schema": { "format": "int64", "type": "integer" } }, { "description": "Namespace of the Relation Tuple", "in": "query", "name": "namespace", "schema": { "type": "string" } }, { "description": "Object of the Relation Tuple", "in": "query", "name": "object", "schema": { "type": "string" } }, { "description": "Relation of the Relation Tuple", "in": "query", "name": "relation", "schema": { "type": "string" } }, { "description": "SubjectID of the Relation Tuple", "in": "query", "name": "subject_id", "schema": { "type": "string" } }, { "description": "Namespace of the Subject Set", "in": "query", "name": "subject_set.namespace", "schema": { "type": "string" } }, { "description": "Object of the Subject Set", "in": "query", "name": "subject_set.object", "schema": { "type": "string" } }, { "description": "Relation of the Subject Set", "in": "query", "name": "subject_set.relation", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getRelationTuplesResponse" } } }, "description": "getRelationTuplesResponse" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Query relation tuples", "tags": ["read"] } }, "/relation-tuples/check": { "get": { "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", "operationId": "getCheckMirrorStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getCheckResponse" } } }, "description": "getCheckResponse" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getCheckResponse" } } }, "description": "getCheckResponse" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Check a relation tuple", "tags": ["read"] }, "post": { "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", "operationId": "postCheckMirrorStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getCheckResponse" } } }, "description": "getCheckResponse" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getCheckResponse" } } }, "description": "getCheckResponse" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Check a relation tuple", "tags": ["read"] } }, "/relation-tuples/check/openapi": { "get": { "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", "operationId": "getCheck", "parameters": [ { "description": "Namespace of the Relation Tuple", "in": "query", "name": "namespace", "schema": { "type": "string" } }, { "description": "Object of the Relation Tuple", "in": "query", "name": "object", "schema": { "type": "string" } }, { "description": "Relation of the Relation Tuple", "in": "query", "name": "relation", "schema": { "type": "string" } }, { "description": "SubjectID of the Relation Tuple", "in": "query", "name": "subject_id", "schema": { "type": "string" } }, { "description": "Namespace of the Subject Set", "in": "query", "name": "subject_set.namespace", "schema": { "type": "string" } }, { "description": "Object of the Subject Set", "in": "query", "name": "subject_set.object", "schema": { "type": "string" } }, { "description": "Relation of the Subject Set", "in": "query", "name": "subject_set.relation", "schema": { "type": "string" } }, { "in": "query", "name": "max-depth", "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getCheckResponse" } } }, "description": "getCheckResponse" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Check a relation tuple", "tags": ["read"] }, "post": { "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", "operationId": "postCheck", "parameters": [ { "in": "query", "name": "max-depth", "schema": { "format": "int64", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/relationQuery" } } }, "x-originalParamName": "Payload" }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getCheckResponse" } } }, "description": "getCheckResponse" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Check a relation tuple", "tags": ["read"] } }, "/relation-tuples/expand": { "get": { "description": "Use this endpoint to expand a relation tuple.", "operationId": "getExpand", "parameters": [ { "description": "Namespace of the Subject Set", "in": "query", "name": "namespace", "required": true, "schema": { "type": "string" } }, { "description": "Object of the Subject Set", "in": "query", "name": "object", "required": true, "schema": { "type": "string" } }, { "description": "Relation of the Subject Set", "in": "query", "name": "relation", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "max-depth", "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/expandTree" } } }, "description": "expandTree" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/genericError" } } }, "description": "genericError" } }, "summary": "Expand a Relation Tuple", "tags": ["read"] } }, "/version": { "get": { "description": "This endpoint returns the version of Ory Keto.\n\nIf the service supports TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto` header to be set.\n\nBe aware that if you are running multiple nodes of this service, the version will never\nrefer to the cluster state, only to a single instance.", "operationId": "getVersion", "responses": { "200": { "content": { "application/json": { "schema": { "properties": { "version": { "description": "The version of Ory Keto.", "type": "string" } }, "required": ["version"], "type": "object" } } }, "description": "Returns the Ory Keto version." } }, "summary": "Return Running Software Version.", "tags": ["metadata"] } } } }