{ "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": { "CreateRelationTupleBadRequestBody": { "description": "CreateRelationTupleBadRequestBody CreateRelationTupleBadRequestBody create relation tuple bad request body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "CreateRelationTupleInternalServerErrorBody": { "description": "CreateRelationTupleInternalServerErrorBody CreateRelationTupleInternalServerErrorBody create relation tuple internal server error body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "DeleteRelationTuplesBadRequestBody": { "description": "DeleteRelationTuplesBadRequestBody DeleteRelationTuplesBadRequestBody DeleteRelationTuplesBadRequestBody DeleteRelationTuplesBadRequestBody DeleteRelationTuplesBadRequestBody delete relation tuples bad request body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "DeleteRelationTuplesInternalServerErrorBody": { "description": "DeleteRelationTuplesInternalServerErrorBody DeleteRelationTuplesInternalServerErrorBody delete relation tuples internal server error body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "GetCheckBadRequestBody": { "description": "GetCheckBadRequestBody GetCheckBadRequestBody GetCheckBadRequestBody GetCheckBadRequestBody GetCheckBadRequestBody get check bad request body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "GetCheckInternalServerErrorBody": { "description": "GetCheckInternalServerErrorBody GetCheckInternalServerErrorBody GetCheckInternalServerErrorBody get check internal server error body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "GetExpandBadRequestBody": { "description": "GetExpandBadRequestBody GetExpandBadRequestBody GetExpandBadRequestBody GetExpandBadRequestBody get expand bad request body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "GetExpandInternalServerErrorBody": { "description": "GetExpandInternalServerErrorBody GetExpandInternalServerErrorBody get expand internal server error body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "GetExpandNotFoundBody": { "description": "GetExpandNotFoundBody GetExpandNotFoundBody GetExpandNotFoundBody GetExpandNotFoundBody get expand not found body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "GetRelationTuplesInternalServerErrorBody": { "description": "GetRelationTuplesInternalServerErrorBody GetRelationTuplesInternalServerErrorBody get relation tuples internal server error body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "GetRelationTuplesNotFoundBody": { "description": "GetRelationTuplesNotFoundBody GetRelationTuplesNotFoundBody get relation tuples not found body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "InternalRelationTuple": { "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 are required.", "type": "string" }, "subject_set": { "$ref": "#/components/schemas/SubjectSet" } }, "required": [ "namespace", "object", "relation" ], "type": "object" }, "IsInstanceAliveInternalServerErrorBody": { "description": "IsInstanceAliveInternalServerErrorBody IsInstanceAliveInternalServerErrorBody IsInstanceAliveInternalServerErrorBody IsInstanceAliveInternalServerErrorBody is instance alive internal server error body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "PatchDelta": { "description": "PatchDelta PatchDelta PatchDelta PatchDelta PatchDelta PatchDelta patch delta", "properties": { "action": { "description": "action", "enum": [ "[[[[[[insert delete]]]]]]" ], "type": "string" }, "relation_tuple": { "$ref": "#/components/schemas/InternalRelationTuple" } }, "type": "object" }, "PatchRelationTuplesBadRequestBody": { "description": "PatchRelationTuplesBadRequestBody PatchRelationTuplesBadRequestBody patch relation tuples bad request body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "PatchRelationTuplesInternalServerErrorBody": { "description": "PatchRelationTuplesInternalServerErrorBody PatchRelationTuplesInternalServerErrorBody patch relation tuples internal server error body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "PatchRelationTuplesNotFoundBody": { "description": "PatchRelationTuplesNotFoundBody PatchRelationTuplesNotFoundBody patch relation tuples not found body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "PostCheckBadRequestBody": { "description": "PostCheckBadRequestBody PostCheckBadRequestBody PostCheckBadRequestBody PostCheckBadRequestBody PostCheckBadRequestBody PostCheckBadRequestBody post check bad request body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "PostCheckInternalServerErrorBody": { "description": "PostCheckInternalServerErrorBody PostCheckInternalServerErrorBody post check internal server error body", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "status", "type": "string" } }, "type": "object" }, "RelationQuery": { "description": "RelationQuery RelationQuery RelationQuery RelationQuery RelationQuery RelationQuery relation query", "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" } }, "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" }, "UUID": { "format": "uuid4", "type": "string" }, "expandTree": { "properties": { "children": { "description": "children", "items": { "$ref": "#/components/schemas/expandTree" }, "type": "array" }, "subject_id": { "description": "subject id", "type": "string" }, "subject_set": { "$ref": "#/components/schemas/SubjectSet" }, "type": { "enum": [ "union", "exclusion", "intersection", "leaf" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, "genericError": { "description": "The standard error format", "properties": { "code": { "description": "code", "format": "int64", "type": "integer" }, "details": { "description": "details", "items": { "additionalProperties": true, "type": "object" }, "type": "array" }, "message": { "description": "message", "type": "string" }, "reason": { "description": "reason", "type": "string" }, "request": { "description": "request", "type": "string" }, "status": { "description": "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": "GetCheckResponse Represents the response for a check request.", "type": "object" }, "getRelationTuplesResponse": { "description": "GetRelationTuplesResponse GetRelationTuplesResponse GetRelationTuplesResponse GetRelationTuplesResponse GetRelationTuplesResponse get relation tuples response", "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": { "description": "relation tuples", "items": { "$ref": "#/components/schemas/InternalRelationTuple" }, "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": { "description": "HealthStatus health status", "properties": { "status": { "description": "Status always contains \"ok\".", "type": "string" } }, "type": "object" }, "subject": { "description": "Subject Subject Subject subject", "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 Oathkeeper's APIs.\n", "license": { "name": "Apache 2.0" }, "title": "Ory Oathkeeper API", "version": "" }, "openapi": "3.0.3", "paths": { "/check": { "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" }, "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": "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" }, "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" ] } }, "/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" ] } }, "/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" ] } }, "/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" ] }, "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" ] }, "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" ] } }, "/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" ] } } } }