using OsoCloud;
string? apiKey = Environment.GetEnvironmentVariable("OSO_CLOUD_API_KEY");
var oso = new Oso("https://api.osohq.com", apiKey);
// Basic query building
var actor = new Value("User", "alice");
var repository = new Value("Repository", "anvils");
var query = oso.BuildQuery("allow", actor, "read", repository);
var result = await query.Evaluate(repository);
// Add constraints with 'And'
var folder = new Value("Folder", "docs");
var constrainedQuery = oso.BuildQuery("allow", actor, "read", repository)
.And("has_relation", repository, "folder", folder);
// Different evaluation modes
bool exists = await query.Evaluate(); // Boolean
var actions = await query.Evaluate("action"); // Single variable
var pairs = await query.Evaluate(new[] { "action", "repository" }); // Tuple variables
{ "results": [ {} ]}
{
"message": "<string>"
}
Authorization Check
Post evaluate query
Query v2: query for any expression.
Unlike GET /facts, which only lists facts you’ve added to Oso Cloud, you can use POST /evaluate_query to list derived information about any rule in your policy.
using OsoCloud;
string? apiKey = Environment.GetEnvironmentVariable("OSO_CLOUD_API_KEY");
var oso = new Oso("https://api.osohq.com", apiKey);
// Basic query building
var actor = new Value("User", "alice");
var repository = new Value("Repository", "anvils");
var query = oso.BuildQuery("allow", actor, "read", repository);
var result = await query.Evaluate(repository);
// Add constraints with 'And'
var folder = new Value("Folder", "docs");
var constrainedQuery = oso.BuildQuery("allow", actor, "read", repository)
.And("has_relation", repository, "folder", folder);
// Different evaluation modes
bool exists = await query.Evaluate(); // Boolean
var actions = await query.Evaluate("action"); // Single variable
var pairs = await query.Evaluate(new[] { "action", "repository" }); // Tuple variables
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Oso Cloud Documentation","colors":{"primary":"#392396","light":"#A78BFA","dark":"#392396"},"logo":{"light":"https://mintcdn.com/osoinc/IZptQQUcDTzNnhFZ/logo/logo_black.svg?fit=max\u0026auto=format\u0026n=IZptQQUcDTzNnhFZ\u0026q=85\u0026s=a23ba87f23f09fee12a107724078979d","dark":"https://mintcdn.com/osoinc/IZptQQUcDTzNnhFZ/logo/logo_white.svg?fit=max\u0026auto=format\u0026n=IZptQQUcDTzNnhFZ\u0026q=85\u0026s=f243e8e50bd0474e6481419e6c602335"},"favicon":"https://mintcdn.com/osoinc/HuMviHxd0NHscL55/favicon.png?fit=max\u0026auto=format\u0026n=HuMviHxd0NHscL55\u0026q=85\u0026s=462aeacb44be5e00705afebb98f0ea1b","api":{"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","python","javascript","go","java","ruby","csharp"]}},"navbar":{"links":[{"href":"https://www.osohq.com/meet-oso","label":"Meet an Engineer"}],"primary":{"type":"button","label":"Try Oso for free","href":"https://ui.osohq.com/"}},"footer":{"socials":{"x":"https://x.com/osohq","github":"https://github.com/osohq","linkedin":"https://www.linkedin.com/company/osohq","slack":"https://join-slack.osohq.com/","youtube":"https://www.youtube.com/@oso-authorization"}},"fonts":{"family":"Inter"},"integrations":{"gtm":{"tagId":"GTM-MK29QFG"}},"banner":{"content":"**AI agents are everywhere.** [See what yours are doing →](https://www.osohq.com/post/introducing-oso-for-coding-agents)","dismissible":true},"contextual":{"options":["copy","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://osohq.com/blog"},{"anchor":"Status Page","icon":"wifi","href":"https://oso.statuspage.io/"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"osoinc","hasAudioNarration":false,"actualSubdomain":"osoinc","customDomains":["www.osohq.com"],"gitSource":{"type":"github","owner":"osohq","repo":"oso-cloud-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adf92850461319c0aa1df69","collectionId":"41c75d83-80b3-44ae-9561-b735be5940e9","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adf92850461319c0aa1df69"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adf92850461319c0aa1df69","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Oso for Apps","count":123},{"language":"default","tag":"Reference","count":71},{"language":"default","tag":"Docs","count":43},{"language":"default","tag":"HTTP API","count":40},{"language":"default","tag":"Develop","count":34},{"language":"default","tag":"Oso for Agents","count":30},{"language":"default","tag":"SDKs","count":20},{"language":"default","tag":"Write Policies","count":16},{"language":"default","tag":"Learn","count":11},{"language":"default","tag":"Changelog","count":11}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"reference/api/check-api/post-evaluate_query","slug":"/reference/api/check-api/post-evaluate_query","pageMetadata":{"openapi":"post /evaluate_query","title":null,"description":"Query v2: query for any expression.\n\nUnlike `GET /facts`, which only lists facts you've added to Oso Cloud, you can use `POST /evaluate_query` to list derived information about any rule in your policy.","href":"/reference/api/check-api/post-evaluate_query"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Query v2: query for any expression.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Unlike \", _jsx(_components.code, {\n children: \"GET /facts\"\n }), \", which only lists facts you’ve added to Oso Cloud, you can use \", _jsx(_components.code, {\n children: \"POST /evaluate_query\"\n }), \" to list derived information about any rule in your policy.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"post /evaluate_query","title":null,"description":"Query v2: query for any expression.\n\nUnlike `GET /facts`, which only lists facts you've added to Oso Cloud, you can use `POST /evaluate_query` to list derived information about any rule in your policy.","href":"/reference/api/check-api/post-evaluate_query"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/osoinc/1de558d9e172e6f8/_nav-example.js"],"openApiReferenceData":{"operation":{"tags":["Check API"],"description":"Query v2: query for any expression.\n\nUnlike `GET /facts`, which only lists facts you've added to Oso Cloud, you can use `POST /evaluate_query` to list derived information about any rule in your policy.","operationId":"post_evaluate_query","requestBody":"3a6aaefe-6caf-49b8-803b-055d03ebf9c3","responses":{"200":"f7e9a0c6-03f7-49cf-94fb-5e0ad8a3f1d4","default":"46f4ae5e-edcf-4aff-bcd6-1599d2921179"},"security":["0112fc32-b1f3-47b7-a782-527521d2583e"],"x-codeSamples":[{"lang":"javascript","label":"Node.js","source":"import { Oso } from 'oso-cloud';\n\nconst apiKey = process.env.OSO_CLOUD_API_KEY;\nconst oso = new Oso(\"https://cloud.osohq.com\", apiKey);\n\n// Basic query building\nconst actor = { type: \"User\", id: \"alice\" };\nconst repository = { type: \"Repository\", id: \"anvils\" };\nconst query = oso.buildQuery([\"allow\", actor, \"read\", repository]);\nconst result = await query.evaluate(repository);\n\n// Add constraints with 'and'\nconst constrainedQuery = oso.buildQuery([\"allow\", actor, \"read\", repository])\n .and([\"has_relation\", repository, \"folder\", { type: \"Folder\", id: \"docs\" }]);\n\n// Different evaluation modes\nconst exists = await query.evaluate(); // Boolean\nconst actions = await query.evaluate(\"action\"); // Single variable\nconst pairs = await query.evaluate([\"action\", \"repository\"]); // Tuple variables\n"},{"lang":"python","label":"Python","source":"import os\nfrom oso_cloud import Oso, Value\n\noso = Oso(api_key=os.environ.get('OSO_CLOUD_API_KEY', None))\n\n# Basic query building\nactor = Value(\"User\", \"alice\")\nrepository = Value(\"Repository\", \"anvils\")\nquery = oso.build_query((\"allow\", actor, \"read\", repository))\nresult = query.evaluate(repository)\n\n# Add constraints with 'and_'\nconstrained_query = oso.build_query((\"allow\", actor, \"read\", repository)) \\\n .and_((\"has_relation\", repository, \"folder\", Value(\"Folder\", \"docs\")))\n\n# Different evaluation modes\nexists = query.evaluate() # Boolean\nactions = query.evaluate(\"action\") # Single variable\npairs = query.evaluate((\"action\", \"repository\")) # Tuple variables\n"},{"lang":"go","label":"Go","source":"package main\n\nimport (\n \"log\"\n \"os\"\n oso \"github.com/osohq/go-oso-cloud/v2\"\n)\n\nfunc main() {\n apiKey := os.Getenv(\"OSO_CLOUD_API_KEY\")\n osoClient := oso.NewClient(\"https://cloud.osohq.com\", apiKey)\n\n// Basic query building\nactor := oso.NewValue(\"User\", \"alice\")\nrepository := oso.NewValue(\"Repository\", \"anvils\")\nquery := osoClient.BuildQuery(oso.NewQueryFact(\"allow\", actor, oso.String(\"read\"), repository))\nrepos, err := query.EvaluateValues(repository)\n\n// Add constraints with 'And'\nfolder := oso.NewValue(\"Folder\", \"docs\")\nconstrainedQuery := osoClient.BuildQuery(oso.NewQueryFact(\"allow\", actor, oso.String(\"read\"), repository)).\n And(oso.NewQueryFact(\"has_relation\", repository, oso.String(\"folder\"), folder))\n\n// Different evaluation modes\nallowed, err := query.EvaluateExists() // Boolean\nactions, err := query.EvaluateValues(oso.NewVariable(\"action\")) // Values for variable\n}\n"},{"lang":"java","label":"Java","source":"package com.mycompany;\n\nimport java.io.IOException;\nimport com.osohq.oso_cloud.Oso;\nimport com.osohq.oso_cloud.api.ApiException;\nimport com.osohq.oso_cloud.api.Value;\n\npublic class App {\n public static void main(String[] args) {\n String apiKey = System.getenv(\"OSO_CLOUD_API_KEY\");\n Oso oso = new Oso(apiKey);\n \n try {\n // Basic query building\n Value actor = new Value(\"User\", \"alice\");\n Value repository = new Value(\"Repository\", \"anvils\");\n var query = oso.buildQuery(\"allow\", actor, \"read\", repository);\n var result = query.evaluate(repository);\n \n // Add constraints with 'and'\n Value folder = new Value(\"Folder\", \"docs\");\n var constrainedQuery = oso.buildQuery(\"allow\", actor, \"read\", repository)\n .and(\"has_relation\", repository, \"folder\", folder);\n \n // Different evaluation modes\n boolean exists = query.evaluate(); // Boolean\n var actions = query.evaluate(\"action\"); // Single variable\n var pairs = query.evaluate(\"action\", \"repository\"); // Tuple variables\n } catch (IOException | ApiException e) {\n System.err.println(\"Error: \" + e.getMessage());\n }\n }\n}\n"},{"lang":"ruby","label":"Ruby","source":"require 'oso-cloud'\n\napi_key = ENV.fetch('OSO_CLOUD_API_KEY', nil)\noso = OsoCloud::Oso.new(url: \"https://cloud.osohq.com\", api_key: api_key)\n\n# Basic query building\nactor = OsoCloud::Value.new(type: \"User\", id: \"alice\")\nrepository = OsoCloud::Value.new(type: \"Repository\", id: \"anvils\")\nquery = oso.build_query([\"allow\", actor, \"read\", repository])\nresult = query.evaluate(repository)\n\n# Add constraints with 'and_'\nfolder = OsoCloud::Value.new(type: \"Folder\", id: \"docs\")\nconstrained_query = oso.build_query([\"allow\", actor, \"read\", repository])\n .and_([\"has_relation\", repository, \"folder\", folder])\n\n# Different evaluation modes\nexists = query.evaluate() # Boolean\nactions = query.evaluate(\"action\") # Single variable\npairs = query.evaluate([\"action\", \"repository\"]) # Tuple variables\n"},{"lang":"csharp","label":"C#","source":"using OsoCloud;\n\nstring? apiKey = Environment.GetEnvironmentVariable(\"OSO_CLOUD_API_KEY\");\nvar oso = new Oso(\"https://api.osohq.com\", apiKey);\n\n// Basic query building\nvar actor = new Value(\"User\", \"alice\");\nvar repository = new Value(\"Repository\", \"anvils\");\nvar query = oso.BuildQuery(\"allow\", actor, \"read\", repository);\nvar result = await query.Evaluate(repository);\n\n// Add constraints with 'And'\nvar folder = new Value(\"Folder\", \"docs\");\nvar constrainedQuery = oso.BuildQuery(\"allow\", actor, \"read\", repository)\n .And(\"has_relation\", repository, \"folder\", folder);\n\n// Different evaluation modes\nbool exists = await query.Evaluate(); // Boolean\nvar actions = await query.Evaluate(\"action\"); // Single variable\nvar pairs = await query.Evaluate(new[] { \"action\", \"repository\" }); // Tuple variables\n"}],"method":"post","type":"path","servers":["f2f58deb-adbe-4826-8a30-0376170d46f8"],"path":"/evaluate_query","baseUrlOptions":["https://api.osohq.com/api/"],"title":"","codeSamples":[{"label":"Node.js","lang":"javascript","source":"import { Oso } from 'oso-cloud';\n\nconst apiKey = process.env.OSO_CLOUD_API_KEY;\nconst oso = new Oso(\"https://cloud.osohq.com\", apiKey);\n\n// Basic query building\nconst actor = { type: \"User\", id: \"alice\" };\nconst repository = { type: \"Repository\", id: \"anvils\" };\nconst query = oso.buildQuery([\"allow\", actor, \"read\", repository]);\nconst result = await query.evaluate(repository);\n\n// Add constraints with 'and'\nconst constrainedQuery = oso.buildQuery([\"allow\", actor, \"read\", repository])\n .and([\"has_relation\", repository, \"folder\", { type: \"Folder\", id: \"docs\" }]);\n\n// Different evaluation modes\nconst exists = await query.evaluate(); // Boolean\nconst actions = await query.evaluate(\"action\"); // Single variable\nconst pairs = await query.evaluate([\"action\", \"repository\"]); // Tuple variables\n"},{"label":"Python","lang":"python","source":"import os\nfrom oso_cloud import Oso, Value\n\noso = Oso(api_key=os.environ.get('OSO_CLOUD_API_KEY', None))\n\n# Basic query building\nactor = Value(\"User\", \"alice\")\nrepository = Value(\"Repository\", \"anvils\")\nquery = oso.build_query((\"allow\", actor, \"read\", repository))\nresult = query.evaluate(repository)\n\n# Add constraints with 'and_'\nconstrained_query = oso.build_query((\"allow\", actor, \"read\", repository)) \\\n .and_((\"has_relation\", repository, \"folder\", Value(\"Folder\", \"docs\")))\n\n# Different evaluation modes\nexists = query.evaluate() # Boolean\nactions = query.evaluate(\"action\") # Single variable\npairs = query.evaluate((\"action\", \"repository\")) # Tuple variables\n"},{"label":"Go","lang":"go","source":"package main\n\nimport (\n \"log\"\n \"os\"\n oso \"github.com/osohq/go-oso-cloud/v2\"\n)\n\nfunc main() {\n apiKey := os.Getenv(\"OSO_CLOUD_API_KEY\")\n osoClient := oso.NewClient(\"https://cloud.osohq.com\", apiKey)\n\n// Basic query building\nactor := oso.NewValue(\"User\", \"alice\")\nrepository := oso.NewValue(\"Repository\", \"anvils\")\nquery := osoClient.BuildQuery(oso.NewQueryFact(\"allow\", actor, oso.String(\"read\"), repository))\nrepos, err := query.EvaluateValues(repository)\n\n// Add constraints with 'And'\nfolder := oso.NewValue(\"Folder\", \"docs\")\nconstrainedQuery := osoClient.BuildQuery(oso.NewQueryFact(\"allow\", actor, oso.String(\"read\"), repository)).\n And(oso.NewQueryFact(\"has_relation\", repository, oso.String(\"folder\"), folder))\n\n// Different evaluation modes\nallowed, err := query.EvaluateExists() // Boolean\nactions, err := query.EvaluateValues(oso.NewVariable(\"action\")) // Values for variable\n}\n"},{"label":"Java","lang":"java","source":"package com.mycompany;\n\nimport java.io.IOException;\nimport com.osohq.oso_cloud.Oso;\nimport com.osohq.oso_cloud.api.ApiException;\nimport com.osohq.oso_cloud.api.Value;\n\npublic class App {\n public static void main(String[] args) {\n String apiKey = System.getenv(\"OSO_CLOUD_API_KEY\");\n Oso oso = new Oso(apiKey);\n \n try {\n // Basic query building\n Value actor = new Value(\"User\", \"alice\");\n Value repository = new Value(\"Repository\", \"anvils\");\n var query = oso.buildQuery(\"allow\", actor, \"read\", repository);\n var result = query.evaluate(repository);\n \n // Add constraints with 'and'\n Value folder = new Value(\"Folder\", \"docs\");\n var constrainedQuery = oso.buildQuery(\"allow\", actor, \"read\", repository)\n .and(\"has_relation\", repository, \"folder\", folder);\n \n // Different evaluation modes\n boolean exists = query.evaluate(); // Boolean\n var actions = query.evaluate(\"action\"); // Single variable\n var pairs = query.evaluate(\"action\", \"repository\"); // Tuple variables\n } catch (IOException | ApiException e) {\n System.err.println(\"Error: \" + e.getMessage());\n }\n }\n}\n"},{"label":"Ruby","lang":"ruby","source":"require 'oso-cloud'\n\napi_key = ENV.fetch('OSO_CLOUD_API_KEY', nil)\noso = OsoCloud::Oso.new(url: \"https://cloud.osohq.com\", api_key: api_key)\n\n# Basic query building\nactor = OsoCloud::Value.new(type: \"User\", id: \"alice\")\nrepository = OsoCloud::Value.new(type: \"Repository\", id: \"anvils\")\nquery = oso.build_query([\"allow\", actor, \"read\", repository])\nresult = query.evaluate(repository)\n\n# Add constraints with 'and_'\nfolder = OsoCloud::Value.new(type: \"Folder\", id: \"docs\")\nconstrained_query = oso.build_query([\"allow\", actor, \"read\", repository])\n .and_([\"has_relation\", repository, \"folder\", folder])\n\n# Different evaluation modes\nexists = query.evaluate() # Boolean\nactions = query.evaluate(\"action\") # Single variable\npairs = query.evaluate([\"action\", \"repository\"]) # Tuple variables\n"},{"label":"C#","lang":"csharp","source":"using OsoCloud;\n\nstring? apiKey = Environment.GetEnvironmentVariable(\"OSO_CLOUD_API_KEY\");\nvar oso = new Oso(\"https://api.osohq.com\", apiKey);\n\n// Basic query building\nvar actor = new Value(\"User\", \"alice\");\nvar repository = new Value(\"Repository\", \"anvils\");\nvar query = oso.BuildQuery(\"allow\", actor, \"read\", repository);\nvar result = await query.Evaluate(repository);\n\n// Add constraints with 'And'\nvar folder = new Value(\"Folder\", \"docs\");\nvar constrainedQuery = oso.BuildQuery(\"allow\", actor, \"read\", repository)\n .And(\"has_relation\", repository, \"folder\", folder);\n\n// Different evaluation modes\nbool exists = await query.Evaluate(); // Boolean\nvar actions = await query.Evaluate(\"action\"); // Single variable\nvar pairs = await query.Evaluate(new[] { \"action\", \"repository\" }); // Tuple variables\n"}],"requestExampleLanguages":["bash","python","javascript","go","java","ruby","csharp"],"requiredOnlyExamples":true,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"description":"A generic query comprising 1+ predicates conjuncted together.","type":"object","required":["calls","constraints","context_facts","predicate"],"properties":{"predicate":{"description":"Predicate name and variable names.\n\nINVARIANT: all variable names must exist in `constraints`. This ensures that all variables at least have a type.","type":"array","items":{"oneOf":[{"0":{"type":"string"},"1":{"type":"array","items":{"type":"string"}}}],"uniqueKey":"predicate.items.[INDEX]","typeLabel":"any"},"maxItems":2,"minItems":2,"isRequired":true,"uniqueKey":"predicate","typeLabel":"any[]"},"calls":{"description":"Predicate name and variable names.\n\nINVARIANT: all variable names must exist in `constraints`. This ensures that all variables at least have a type.","type":"array","items":{"type":"array","items":{"oneOf":[{"0":{"type":"string"},"1":{"type":"array","items":{"type":"string"}}}],"uniqueKey":"calls.items.[INDEX].items.[INDEX]","typeLabel":"any"},"maxItems":2,"minItems":2,"uniqueKey":"calls.items.[INDEX]","typeLabel":"any[]"},"isRequired":true,"uniqueKey":"calls","typeLabel":"any[][]"},"constraints":{"description":"Map of variable names to their type and value(s). Every variable is at least typed and may also be constrained to a set of values.","type":"object","additionalProperties":{"description":"Constraints on a variable. All variables must have a type, and they may also be constrained to a set of values.","type":"object","required":["type"],"properties":{"type":{"description":"The type of the variable.","type":"string","isRequired":true,"uniqueKey":"constraints.additionalProperties.type","typeLabel":"string"},"ids":{"oneOf":[{"description":"The possible values of the variable. `None` means the variable can be any value. `Some([\"foo\"])` means the variable must be exactly `\"foo\"`. `Some([\"foo\", \"bar\"])` means the variable can be either `\"foo\"` or `\"bar\"`. The latter is how we represent `In` expressions in the new Query API.","type":"array","items":{"type":"string","uniqueKey":"constraints.additionalProperties.ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"uniqueKey":"constraints.additionalProperties.ids.oneOf.0","typeLabel":"string[]"},{"description":"The possible values of the variable. `None` means the variable can be any value. `Some([\"foo\"])` means the variable must be exactly `\"foo\"`. `Some([\"foo\", \"bar\"])` means the variable can be either `\"foo\"` or `\"bar\"`. The latter is how we represent `In` expressions in the new Query API.","type":"null","items":{"type":"string"},"uniqueKey":"constraints.additionalProperties.ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"constraints.additionalProperties.ids","typeLabel":"string[] | null"}},"uniqueKey":"constraints.additionalProperties","typeLabel":"object"},"isRequired":true,"uniqueKey":"constraints","typeLabel":"object"},"context_facts":{"type":"array","items":{"description":"A specific piece of authorization-relevant data, ie: a fact.\n\n`ConcreteFact`s are suitable for storing in the database, since they represent the information in a specific, fully-qualified fact. To represent the set of facts matching a pattern instead, see [`Fact`].","type":"object","required":["args","predicate"],"properties":{"predicate":{"type":"string","isRequired":true,"uniqueKey":"context_facts.items.[INDEX].predicate","typeLabel":"string"},"args":{"type":"array","items":{"type":"object","required":["id","type"],"properties":{"type":{"type":"string","isRequired":true,"uniqueKey":"context_facts.items.[INDEX].args.items.[INDEX].type","typeLabel":"string"},"id":{"type":"string","isRequired":true,"uniqueKey":"context_facts.items.[INDEX].args.items.[INDEX].id","typeLabel":"string"}},"uniqueKey":"context_facts.items.[INDEX].args.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"context_facts.items.[INDEX].args","typeLabel":"object[]"}},"uniqueKey":"context_facts.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"context_facts","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"predicate":["\u003cunknown>"],"calls":[["\u003cunknown>"]],"constraints":{},"context_facts":[{"predicate":"\u003cstring>","args":[{"type":"\u003cstring>","id":"\u003cstring>"}]}]}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"f7e9a0c6-03f7-49cf-94fb-5e0ad8a3f1d4":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","additionalProperties":{"oneOf":[{"type":"string","uniqueKey":"results.items.[INDEX].additionalProperties.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"results.items.[INDEX].additionalProperties.oneOf.1","typeLabel":"null"}],"uniqueKey":"results.items.[INDEX].additionalProperties","typeLabel":"string | null"},"uniqueKey":"results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"results","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"results":[{}]}}},"exampleType":"generated"}},"exampleType":"generated"},"46f4ae5e-edcf-4aff-bcd6-1599d2921179":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"0112fc32-b1f3-47b7-a782-527521d2583e":{"ApiKey":{"description":"Requires an API key to access.","type":"http","scheme":"bearer","bearerFormat":"Bearer e_0123_123_token0123","scopes":[]}}},"servers":{"f2f58deb-adbe-4826-8a30-0376170d46f8":{"url":"https://api.osohq.com/api/"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"description":"Requires an API key to access.","type":"http","scheme":"bearer","bearerFormat":"Bearer e_0123_123_token0123","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Requires an API key to access.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKey","name":"Authorization"}],"title":"ApiKey"}]},"originalFileLocation":"reference/openapi.json"},"subdomain":"osoinc","siteName":"Oso Cloud Documentation","title":"Post evaluate query - Oso Cloud Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-05T13:45:43.287Z","originalFileLocation":"reference/api/check-api/post-evaluate_query.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Query v2: query for any expression. Unlike GET /facts, which only lists facts you\u0026#x27;ve added to Oso Cloud, you can use POST /evaluate_query to list derived information about any rule in your policy.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Oso Cloud Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Post evaluate query - Oso Cloud Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Query v2: query for any expression. Unlike GET /facts, which only lists facts you\u0026#x27;ve added to Oso Cloud, you can use POST /evaluate_query to list derived information about any rule in your policy.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Oso Cloud Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://osoinc.mintlify.app/_mintlify/api/og/v2?division=Authorization+Check\u0026amp;title=Post+evaluate+query\u0026amp;description=Query+v2%3A+query+for+any+expression.%0A%0AUnlike+%60GET+%2Ffacts%60%2C+which+only+lists+facts+you%27ve+added+to+Oso+Cloud%2C+you+can+use+%60POST+%2Fevaluate_query%60+to+list+derived+i\u0026amp;theme=eb85f6ae82e81d3487978aff\u0026amp;signature=2de017e6dde6ecf852bf1772471c311556356083a3bd89317e9d1ac18b724a3a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Post evaluate query - Oso Cloud Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Query v2: query for any expression. Unlike GET /facts, which only lists facts you\u0026#x27;ve added to Oso Cloud, you can use POST /evaluate_query to list derived information about any rule in your policy.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://osoinc.mintlify.app/_mintlify/api/og/v2?division=Authorization+Check\u0026amp;title=Post+evaluate+query\u0026amp;description=Query+v2%3A+query+for+any+expression.%0A%0AUnlike+%60GET+%2Ffacts%60%2C+which+only+lists+facts+you%27ve+added+to+Oso+Cloud%2C+you+can+use+%60POST+%2Fevaluate_query%60+to+list+derived+i\u0026amp;theme=eb85f6ae82e81d3487978aff\u0026amp;signature=2de017e6dde6ecf852bf1772471c311556356083a3bd89317e9d1ac18b724a3a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/osoinc/RDBykkEzsN_rr7aZ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Oso Cloud Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#392396\">\u003clink data-mint-head rel=\"canonical\" href=\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/reference/api/check-api/post-evaluate_query.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.osohq.com/#organization\",\"name\":\"Oso Cloud Documentation\",\"url\":\"https://www.osohq.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/osoinc/IZptQQUcDTzNnhFZ/logo/logo_black.svg?fit=max\u0026auto=format\u0026n=IZptQQUcDTzNnhFZ\u0026q=85\u0026s=a23ba87f23f09fee12a107724078979d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://www.osohq.com/docs#website\",\"name\":\"Oso Cloud Documentation\",\"url\":\"https://www.osohq.com/docs\",\"publisher\":{\"@id\":\"https://www.osohq.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query#webpage\",\"url\":\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query\",\"name\":\"Post evaluate query\",\"description\":\"Query v2: query for any expression. Unlike GET /facts, which only lists facts you've added to Oso Cloud, you can use POST /evaluate_query to list derived information about any rule in your policy.\",\"dateModified\":\"2026-08-05T13:45:43.287Z\",\"isPartOf\":{\"@id\":\"https://www.osohq.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HTTP API\",\"item\":\"https://www.osohq.com/docs/reference/api/policy/get-policy\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authorization Check\",\"item\":\"https://www.osohq.com/docs/reference/api/check-api/post-actions\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Post evaluate query\",\"item\":\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query#apireference\",\"headline\":\"Post evaluate query\",\"name\":\"Post evaluate query\",\"description\":\"Query v2: query for any expression. Unlike GET /facts, which only lists facts you've added to Oso Cloud, you can use POST /evaluate_query to list derived information about any rule in your policy.\",\"url\":\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query\",\"mainEntityOfPage\":{\"@id\":\"https://www.osohq.com/docs/reference/api/check-api/post-evaluate_query#webpage\"},\"dateModified\":\"2026-08-05T13:45:43.287Z\",\"publisher\":{\"@id\":\"https://www.osohq.com/#organization\"},\"isPartOf\":{\"@id\":\"https://www.osohq.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Oso Cloud Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Oso Cloud Documentation","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://osohq.com/blog"},{"anchor":"Status Page","icon":"wifi","href":"https://oso.statuspage.io/"}]},"tabs":[{"tab":"Oso for Agents","groups":[{"group":"Get Started","pages":[{"title":"Overview","href":"/oso-for-agents/overview"},{"title":"How It Works","href":"/oso-for-agents/how-it-works"},{"title":"Quickstart: Oso for Agents","sidebarTitle":"Quickstart","href":"/oso-for-agents/quickstart-coding-agents"}]},{"group":"Capabilities","pages":[{"title":"Shadow AI","href":"/oso-for-agents/shadow-ai"},{"title":"Connectors","href":"/oso-for-agents/connectors"},{"title":"Identity Sync","href":"/oso-for-agents/identity-sync"},{"title":"Session Monitoring","href":"/oso-for-agents/session-monitoring"},{"title":"Alerts","href":"/oso-for-agents/alerts"},{"title":"Content Tags","href":"/oso-for-agents/content-tags"},{"title":"Policies","href":"/oso-for-agents/policies"}]},{"group":"Deployment Models","pages":[{"title":"Edge Proxy","href":"/oso-for-agents/integrations/edge-proxy"},{"title":"Browser Extension","href":"/oso-for-agents/integrations/browser-extension"},{"title":"Tailscale Aperture","href":"/oso-for-agents/integrations/tailscale-aperture"},{"group":"Managed Deployment","pages":[{"title":"Overview","href":"/oso-for-agents/integrations/managed-deployment"},{"title":"Jamf","href":"/oso-for-agents/integrations/managed-deployment/jamf"},{"title":"Iru","href":"/oso-for-agents/integrations/managed-deployment/iru"},{"title":"Rippling","href":"/oso-for-agents/integrations/managed-deployment/rippling"}]}]},{"group":"Integrations \u0026 Connections","pages":[{"group":"EDR","pages":[{"title":"EDR","sidebarTitle":"Overview","href":"/oso-for-agents/integrations/edr"},{"title":"CrowdStrike","href":"/oso-for-agents/integrations/edr/crowdstrike"},{"title":"SentinelOne","href":"/oso-for-agents/integrations/edr/sentinelone"}]},{"title":"Slack","href":"/oso-for-agents/integrations/slack"},{"title":"SIEM export","href":"/oso-for-agents/integrations/siem-export"},{"group":"Identity Providers","pages":[{"title":"Okta","href":"/okta"}]}]},{"group":"Self-Hosting","pages":[{"title":"Overview","href":"/oso-for-agents/self-hosting/overview"},{"title":"Requirements","href":"/oso-for-agents/self-hosting/requirements"},{"title":"Installation","href":"/oso-for-agents/self-hosting/installation"},{"title":"Operations","href":"/oso-for-agents/self-hosting/operations"},{"title":"Security","href":"/oso-for-agents/self-hosting/security"}]},{"group":"Reference","pages":[{"title":"Supported Agents","href":"/oso-for-agents/supported-agents"},{"title":"Data Privacy","href":"/oso-for-agents/data-privacy"}]}]},{"tab":"Oso for Apps","dropdowns":[{"dropdown":"Docs","icon":"book-open","groups":[{"group":"Get Started","pages":[{"title":"An Introduction to Oso Cloud","sidebarTitle":"Introduction","href":"/get-started/introduction"},{"title":"Oso Cloud Quickstart","sidebarTitle":"Quickstart","href":"/get-started/quickstart"}]},{"group":"Develop","pages":[{"group":"Local Development","pages":[{"title":"Environment Setup","sidebarTitle":"Environment setup","href":"/develop/local-dev/env-setup"},{"title":"Oso Dev Server","sidebarTitle":"Oso Dev Server","href":"/develop/local-dev/oso-dev-server"},{"title":"Oso Migrate (Beta)","sidebarTitle":"Oso Migrate","href":"/develop/local-dev/oso-migrate"},{"title":"Oso MCP Server","sidebarTitle":"Oso MCP Server","href":"/develop/local-dev/mcp"}]},{"group":"Write Policies","pages":[{"title":"Overview of Polar Language and Syntax","sidebarTitle":"Overview","href":"/develop/policies/overview"},{"title":"Model Role-Based Access Control (RBAC)","sidebarTitle":"RBAC","href":"/develop/policies/rbac"},{"title":"Model Relationship-Based Access Control (ReBAC)","sidebarTitle":"ReBAC","href":"/develop/policies/rebac"},{"title":"Model Attribute-Based Access Control (ABAC)","sidebarTitle":"ABAC","href":"/develop/policies/abac"},{"title":"Fine-grained Authorization (FGA)","sidebarTitle":"FGA","href":"/develop/policies/fga"},{"title":"Model Field-Level Authorization","sidebarTitle":"Field-Level Authorization","href":"/develop/policies/field-level-authorization"},{"title":"Policy Preview","href":"/develop/policies/policy-preview"},{"group":"Patterns","pages":[{"title":"Resource Creation","sidebarTitle":"Resource Creation","href":"/develop/policies/patterns/resource-creation"},{"title":"Conditional Roles","sidebarTitle":"Conditional Roles","href":"/develop/policies/patterns/conditional-roles"},{"title":"Custom Roles","sidebarTitle":"Custom Roles","href":"/develop/policies/patterns/custom-roles"},{"title":"Entitlements","sidebarTitle":"Entitlements","href":"/develop/policies/patterns/entitlements"},{"title":"Impersonation","sidebarTitle":"Impersonation","href":"/develop/policies/patterns/impersonation"},{"title":"Organization Hierarchies","sidebarTitle":"Organization Hierarchies","href":"/develop/policies/patterns/organizational-hierarchy"},{"title":"Resource Sharing","sidebarTitle":"Resource Sharing","href":"/develop/policies/patterns/resource-sharing"},{"title":"Time-based Checks","sidebarTitle":"Time-based Checks","href":"/develop/policies/patterns/time-based-checks"},{"title":"User Groups","sidebarTitle":"User Groups","href":"/develop/policies/patterns/user-groups"}]}]},{"group":"Manage Facts","pages":[{"title":"Overview of Facts","sidebarTitle":"Overview","href":"/develop/facts/overview"},{"title":"Insert facts","sidebarTitle":"Insert facts","href":"/develop/facts/insert-facts"},{"title":"Update facts","sidebarTitle":"Update facts","href":"/develop/facts/update-facts"},{"title":"Sync facts","sidebarTitle":"Sync facts","href":"/develop/facts/sync-facts"},{"title":"Export Facts","sidebarTitle":"Export facts","href":"/develop/facts/export-facts"},{"title":"Context Facts","sidebarTitle":"Context facts","href":"/develop/facts/context-facts"},{"title":"Local Authorization","sidebarTitle":"Local Authorization","href":"/develop/facts/local-authorization"}]},{"group":"Enforce Permissions","pages":[{"title":"Authorize Requests","sidebarTitle":"Authorize requests","href":"/develop/enforce/authorize-requests"},{"title":"Enforcement strategies","sidebarTitle":"Enforcement strategies","href":"/develop/enforce/enforcement-strategies"},{"title":"Query Oso Cloud","sidebarTitle":"Query Oso Cloud","href":"/develop/enforce/query-facts"},{"title":"List filtering","sidebarTitle":"List filtering","href":"/develop/enforce/list-filtering"}]},{"group":"Troubleshooting","pages":[{"title":"Logs and auditing","sidebarTitle":"Logs","href":"/develop/troubleshooting/logs"},{"title":"Debugging a Policy","sidebarTitle":"Debugging","href":"/develop/troubleshooting/debugging"},{"title":"Query performance","sidebarTitle":"Query performance","href":"/develop/troubleshooting/query-performance"}]}]},{"group":"Deploy and Manage","pages":[{"title":"Deployment models","sidebarTitle":"Deployment models","href":"/deploy/deployment-models"},{"title":"Oso Fallback - Hybrid Deployment","sidebarTitle":"Fallback nodes","href":"/deploy/fallback-nodes"},{"title":"Backup \u0026 Point-in-time Recovery","sidebarTitle":"Backups and recovery","href":"/deploy/backups-and-recovery"},{"title":"CI/CD with Oso Cloud","sidebarTitle":"CI/CD","href":"/deploy/ci-cd"},{"group":"Account Management","pages":[{"title":"Configuring your account","sidebarTitle":"Account configuration","href":"/deploy/account-management/configuration"},{"title":"Service limits","sidebarTitle":"Service limits","href":"/deploy/account-management/rate-limits"},{"title":"Single Sign-On (SSO) Configuration","sidebarTitle":"SSO","href":"/deploy/account-management/sso"}]}]}]},{"dropdown":"Reference","icon":"square-terminal","groups":[{"group":"Polar","pages":[{"title":"The Polar Language in Oso Cloud","sidebarTitle":"Introduction","href":"/reference/polar/introduction"},{"title":"Polar Rules and Facts","sidebarTitle":"Rules and Facts","href":"/reference/polar/rules-and-facts"},{"title":"Facts as Data","sidebarTitle":"Facts as Data","href":"/reference/polar/facts-as-data"},{"title":"Polar Built-In Types","sidebarTitle":"Types","href":"/reference/polar/types"},{"title":"Polar Operators","sidebarTitle":"Operators","href":"/reference/polar/operators"},{"title":"Resource Blocks","sidebarTitle":"Resource Blocks","href":"/reference/polar/resource-blocks"},{"title":"Polar Polymorphism","sidebarTitle":"Extends","href":"/reference/polar/extends"},{"title":"Polar Built-In Constants","sidebarTitle":"Constants","href":"/reference/polar/constants"},{"title":"Polar Tests","sidebarTitle":"Tests","href":"/reference/polar/tests"}]},{"group":"HTTP API","pages":[{"group":"Policies","pages":[{"openapi":"get /policy","title":null,"href":"/reference/api/policy/get-policy"},{"openapi":"get /policy_metadata","title":null,"href":"/reference/api/policy/get-policy_metadata"},{"openapi":"post /policy","title":null,"href":"/reference/api/policy/post-policy"}]},{"group":"Facts","pages":[{"openapi":"post /batch","title":null,"href":"/reference/api/centralized-authorization-data/post-batch"},{"openapi":"post /clear_data","title":null,"href":"/reference/api/centralized-authorization-data/post-clear_data"},{"openapi":"post /facts","deprecated":true,"title":null,"href":"/reference/api/centralized-authorization-data/post-facts"},{"openapi":"post /bulk","deprecated":true,"title":null,"href":"/reference/api/centralized-authorization-data/post-bulk"},{"openapi":"post /bulk_load","deprecated":true,"title":null,"href":"/reference/api/centralized-authorization-data/post-bulk_load"},{"openapi":"post /bulk_delete","deprecated":true,"title":null,"href":"/reference/api/centralized-authorization-data/post-bulk_delete"},{"openapi":"delete /facts","deprecated":true,"title":null,"href":"/reference/api/centralized-authorization-data/delete-facts"}]},{"group":"Authorization Check","pages":[{"openapi":"post /actions","title":null,"href":"/reference/api/check-api/post-actions"},{"openapi":"post /authorize_resources","title":null,"href":"/reference/api/check-api/post-authorize_resources"},{"openapi":"post /authorize","title":null,"description":"Determines whether or not an actor can take an action on a resource, based on a combination of authorization data and policy logic.","href":"/reference/api/check-api/post-authorize"},{"openapi":"post /evaluate_query","title":null,"href":"/reference/api/check-api/post-evaluate_query"},{"openapi":"post /list","title":null,"description":"Fetches a list of resource IDs on which an actor can perform a particular action.","href":"/reference/api/check-api/post-list"},{"openapi":"post /query","deprecated":true,"title":null,"href":"/reference/api/check-api/post-query"}]},{"group":"Local Authorization Check","pages":[{"openapi":"post /actions_query","title":null,"href":"/reference/api/local-check-api/post-actions_query"},{"openapi":"post /authorize_query","title":null,"href":"/reference/api/local-check-api/post-authorize_query"},{"openapi":"post /evaluate_query_local","title":null,"href":"/reference/api/local-check-api/post-evaluate_query_local"},{"openapi":"post /list_query","title":null,"href":"/reference/api/local-check-api/post-list_query"}]},{"group":"Policy","pages":[{"title":"Get policy","deprecated":null,"version":null,"openapi":"/reference/openapi.json get /policy","href":"/api-reference/policy/get-policy"},{"title":"Post policy","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /policy","href":"/api-reference/policy/post-policy"},{"title":"Get policy metadata","deprecated":null,"version":null,"openapi":"/reference/openapi.json get /policy_metadata","href":"/api-reference/policy/get-policy_metadata"}]},{"group":"Centralized Authorization Data","pages":[{"title":"Post facts","deprecated":true,"version":null,"openapi":"/reference/openapi.json post /facts","href":"/api-reference/centralized-authorization-data/post-facts"},{"title":"Delete facts","deprecated":true,"version":null,"openapi":"/reference/openapi.json delete /facts","href":"/api-reference/centralized-authorization-data/delete-facts"},{"title":"Post bulk load","deprecated":true,"version":null,"openapi":"/reference/openapi.json post /bulk_load","href":"/api-reference/centralized-authorization-data/post-bulk_load"},{"title":"Post bulk delete","deprecated":true,"version":null,"openapi":"/reference/openapi.json post /bulk_delete","href":"/api-reference/centralized-authorization-data/post-bulk_delete"},{"title":"Post bulk","deprecated":true,"version":null,"openapi":"/reference/openapi.json post /bulk","href":"/api-reference/centralized-authorization-data/post-bulk"},{"title":"Post batch","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /batch","href":"/api-reference/centralized-authorization-data/post-batch"},{"title":"Post clear data","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /clear_data","href":"/api-reference/centralized-authorization-data/post-clear_data"}]},{"group":"Check API","pages":[{"title":"Post authorize","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /authorize","href":"/api-reference/check-api/post-authorize"},{"title":"Post authorize resources","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /authorize_resources","href":"/api-reference/check-api/post-authorize_resources"},{"title":"Post list","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /list","href":"/api-reference/check-api/post-list"},{"title":"Post actions","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /actions","href":"/api-reference/check-api/post-actions"},{"title":"Post query","deprecated":true,"version":null,"openapi":"/reference/openapi.json post /query","href":"/api-reference/check-api/post-query"},{"title":"Post evaluate query","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /evaluate_query","href":"/api-reference/check-api/post-evaluate_query"}]},{"group":"Local Check API","pages":[{"title":"Post actions query","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /actions_query","href":"/api-reference/local-check-api/post-actions_query"},{"title":"Post authorize query","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /authorize_query","href":"/api-reference/local-check-api/post-authorize_query"},{"title":"Post list query","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /list_query","href":"/api-reference/local-check-api/post-list_query"},{"title":"Post evaluate query local","deprecated":null,"version":null,"openapi":"/reference/openapi.json post /evaluate_query_local","href":"/api-reference/local-check-api/post-evaluate_query_local"}]}]},{"group":"SDKs","pages":[{"title":"Oso Cloud SDKs","sidebarTitle":"Overview","href":"/reference/sdks/overview"},{"title":"Installation and Setup","sidebarTitle":"Install","href":"/reference/sdks/install"},{"title":"Policy Management","sidebarTitle":"Policies","href":"/reference/sdks/policies"},{"title":"Facts Management","sidebarTitle":"Facts","href":"/reference/sdks/facts"},{"title":"Authorization Checks","sidebarTitle":"Authorization Checks","href":"/reference/sdks/authorization-checks"},{"title":"Local Authorization","sidebarTitle":"Local Authorization","href":"/reference/sdks/local-authorization"},{"title":"Migration Guide","sidebarTitle":"Migration Guide","href":"/reference/sdks/migration-guide"},{"title":"SDK Specific Guidance","sidebarTitle":"SDK Specific Guidance","href":"/reference/sdks/sdk-specific-guidance"},{"group":"Integrations","pages":[{"title":"SQLAlchemy Local Authorization Integration","sidebarTitle":"SQLAlchemy","href":"/reference/sdks/integrations/sqlalchemy"},{"title":"Mcp","href":"/reference/sdks/integrations/mcp"}]},{"group":"Changelog","pages":[{"title":"What's New in Oso Cloud","sidebarTitle":"What's New","href":"/reference/sdks/changelog/whats-new"},{"title":"CLI Changelog","sidebarTitle":"CLI","href":"/reference/sdks/changelog/oso-cloud-cli"},{"title":"Node.js SDK Changelog","sidebarTitle":"Node.js","href":"/reference/sdks/changelog/nodejs"},{"title":"Python SDK Changelog","sidebarTitle":"Python","href":"/reference/sdks/changelog/python"},{"title":"Ruby SDK Changelog","sidebarTitle":"Ruby","href":"/reference/sdks/changelog/ruby"},{"title":"Java SDK Changelog","sidebarTitle":"Java","href":"/reference/sdks/changelog/java"},{"title":"Go SDK Changelog","sidebarTitle":"Go","href":"/reference/sdks/changelog/go"},{"title":".NET SDK Changelog","sidebarTitle":".NET","href":"/reference/sdks/changelog/dotnet"},{"title":"Fallback Node Changelog","sidebarTitle":"Fallback Node","href":"/reference/sdks/changelog/fallback"},{"title":"Dev Server Changelog","sidebarTitle":"Dev Server","href":"/reference/sdks/changelog/oso-dev-server"},{"title":"VSCode Extension Changelog","sidebarTitle":"VSCode Extension","href":"/reference/sdks/changelog/vscode-extension"}]}]}]},{"dropdown":"Learn","icon":"graduation-cap","groups":[{"group":"Tutorials","pages":[{"title":"An End-to-End Example Securing a Real World App with Oso Cloud","sidebarTitle":"End-to-End Example","href":"/learn/tutorials/end-to-end-example"},{"title":"An illustration of a local development workflow for Oso Cloud","sidebarTitle":"Workflow Walkthrough","href":"/learn/tutorials/workflow-walkthrough"}]},{"group":"Guides","pages":[{"group":"Adopt Local Authorization","pages":[{"title":"Getting started","href":"/learn/guides/adopt-local-authorization/getting-started"},{"title":"Extract authorization logic","href":"/learn/guides/adopt-local-authorization/extract-logic"},{"title":"Implement in Oso Cloud","href":"/learn/guides/adopt-local-authorization/implement-in-oso-cloud"},{"title":"Send data as context facts","href":"/learn/guides/adopt-local-authorization/data-as-context-facts"},{"title":"Replace Context Facts with Local Authorization","sidebarTitle":"Replace with local authorization","href":"/learn/guides/adopt-local-authorization/replace-with-local-authorization"},{"title":"Authorize with Oso Cloud","href":"/learn/guides/adopt-local-authorization/authorize-with-oso-cloud"}]},{"title":"How to map relational data to facts","sidebarTitle":"Map Relational Data to Facts","href":"/learn/guides/map-relational-data-to-facts"},{"title":"Best Practices for Frontend Authorization","sidebarTitle":"Frontend (UI)","href":"/learn/guides/ui"},{"title":"Integrating Authentication (Identity) Data","sidebarTitle":"Authentication","href":"/learn/guides/authentication"}]}]}]}]},"basePath":"","title":"Post evaluate query - Oso Cloud Documentation","buildId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","deploymentId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["BannerMarkdown-CGuHEvQW.js","dist-B66mVNPp.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-BcghKhHb.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-CLz2_Z5D.js","utils-7A5jZhOT.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BVWmkKuv.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-4SOfrh0F.js","snippetPresets-CMc8KicP.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Ba9tX7z3.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-Be8krXvv.js","shallow-CBC3K1uB.js","getApiPlaygroundDisplay-4tKcUAYo.js","CodeSnippet-C1Xa06ft.js","CodeSnippets-vqiz27A_.js","Page-DeQN5MDd.js","getPastedJson-NUwRfM32.js","icon-DkIVqWh9.js","MethodPill-qmhT7_wz.js","DuplicateIcon-_gWp1vhn.js","createIcon-NA1p_TVA.js","DynamicMarkdown-Bas9A7wq.js","SectionHeading-a1cS-24U.js","axios-vUo_bRtp.js","Markdown-D3ZTwq_a.js","AssistantPageLink-DmooSyTN.js"]}