Skip to main content
POST
/
evaluate_query
cURL
curl --request POST \
  --url https://api.osohq.com/api/evaluate_query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "predicate": [
    "<any>"
  ],
  "calls": [
    [
      "<any>"
    ]
  ],
  "constraints": {},
  "context_facts": [
    {
      "predicate": "<string>",
      "args": [
        {
          "type": "<string>",
          "id": "<string>"
        }
      ]
    }
  ]
}'
{
  "results": [
    {}
  ]
}

Authorizations

Authorization
string
header
required

Requires an API key to access. Signup at https://ui.osohq.com/

Body

application/json

A generic query comprising 1+ predicates conjuncted together.

predicate
any[]
required

Predicate name and variable names.

INVARIANT: all variable names must exist in constraints. This ensures that all variables at least have a type.

Required array length: 2 elements
calls
any[][]
required

Predicate name and variable names.

INVARIANT: all variable names must exist in constraints. This ensures that all variables at least have a type.

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
object[]
required

Response

results
object[]
required