---
title: "POST /evaluate_query_local"
method: POST
path: "/evaluate_query_local"
tags: ["Local Check API"]
---

# POST /evaluate_query_local

`POST /evaluate_query_local`

Fetches a SQL query that can be run against your database to answer arbitrary questions about authorization.

## Request body

- LocalQuery
  - `query` Query, required — A generic query comprising 1+ predicates conjuncted together.
    - `predicate` unknown[], required — Predicate name and variable names. INVARIANT: all variable names must exist in `constraints`. This ensures that all variables at least have a type.
      - unknown
    - `calls` array[], required — Predicate name and variable names. INVARIANT: all variable names must exist in `constraints`. This ensures that all variables at least have a type.
      - unknown[]
        - unknown
    - `constraints` object, required — 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.
    - `context_facts` ConcreteFact[], required
      - `predicate` string, required
      - `args` TypedId[], required
        - `type` string, required
        - `id` string, required
  - `data_bindings` string, required
  - `mode` union, required
    - object
      - `mode` 'select', required
      - `query_vars_to_output_column_names` object, required
    - object
      - `mode` 'filter', required
      - `query_var` string, required
      - `output_column_name` string, required

## Response `200`

- LocalQueryResult
  - `sql` string, required

## Other responses

- `default`

---

[API](https://skmtc.net/osohq/apis/oso-cloud-http-api.md) · [All operations](https://skmtc.net/osohq/apis/oso-cloud-http-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/osohq/oso-cloud-http-api/versions/edaea3b218bd/schema)
