Styra Batch API
The Batch API from Styra — 1 operation(s) for batch.
Operations 1
Documentation
Documentation
https://www.openpolicyagent.org/docs
APIReference
https://www.openpolicyagent.org/docs/rest-api
The Batch API from Styra — 1 operation(s) for batch.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/styra-batch-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Enterprise OPA REST Batch API
version: 0.2.0
contact:
name: Styra
url: https://github.com/StyraInc/enterprise-opa
servers:
- url: http://localhost:8181
description: Local development server
security:
- {}
- bearerAuth: []
tags:
- name: Batch
paths:
/v1/batch/data/{path}:
post:
parameters:
- $ref: '#/components/parameters/policyPath'
- $ref: '#/components/parameters/GzipContentEncoding'
- $ref: '#/components/parameters/GzipAcceptEncoding'
- $ref: '#/components/parameters/pretty'
- $ref: '#/components/parameters/provenance'
- $ref: '#/components/parameters/explain'
- $ref: '#/components/parameters/metrics'
- $ref: '#/components/parameters/instrument'
- $ref: '#/components/parameters/strict-builtin-errors'
summary: Execute a policy given a batch of inputs
operationId: executeBatchPolicyWithInput
x-speakeasy-usage-example: true
requestBody:
description: The batch of inputs
required: true
content:
application/json:
schema:
type: object
required:
- inputs
properties:
inputs:
type: object
additionalProperties:
$ref: '#/components/schemas/input'
responses:
'200':
$ref: '#/components/responses/BatchSuccessfulPolicyEvaluation'
'207':
$ref: '#/components/responses/BatchMixedResults'
'400':
$ref: '#/components/responses/BadRequest'
'500':
$ref: '#/components/responses/BatchServerError'
tags:
- Batch
components:
parameters:
strict-builtin-errors:
name: strict-builtin-errors
description: Treat built-in function call errors as fatal and return an error immediately.
in: query
schema:
type: boolean
metrics:
name: metrics
description: Return query performance metrics in addition to result.
in: query
schema:
type: boolean
GzipAcceptEncoding:
name: Accept-Encoding
description: Indicates the server should respond with a gzip encoded body. The server will send the compressed response only if its length is above `server.encoding.gzip.min_length` value. See the configuration section
in: header
schema:
type: string
enum:
- gzip
instrument:
name: instrument
description: Instrument query evaluation and return a superset of performance metrics in addition to result.
in: query
schema:
type: boolean
policyPath:
name: path
in: path
description: The path separator is used to access values inside object and array documents. If the path indexes into an array, the server will attempt to convert the array index to an integer. If the path element cannot be converted to an integer, the server will respond with 404.
required: true
schema:
type: string
default: ''
format: urlPath
example: app/rbac
explain:
name: explain
description: Return query explanation in addition to result.
in: query
schema:
type: string
enum:
- notes
- fails
- full
- debug
pretty:
name: pretty
description: If parameter is `true`, response will formatted for humans.
in: query
schema:
type: boolean
provenance:
name: provenance
description: If parameter is true, response will include build/version info in addition to the result.
in: query
schema:
type: boolean
GzipContentEncoding:
name: Content-Encoding
description: Indicates that the request body is gzip encoded
in: header
schema:
type: string
enum:
- gzip
responses:
BatchSuccessfulPolicyEvaluation:
description: 'All batched policy executions succeeded.
The server also returns 200 if the path refers to an undefined document. In this case, responses will be empty.
'
headers:
Content-Encoding:
$ref: '#/components/headers/GzipContentEncoding'
content:
application/json:
schema:
type: object
properties:
batch_decision_id:
type: string
example: 1bef6b7d-cd13-4890-bfe1-fd2e8de32189
metrics:
type: object
description: If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
additionalProperties: true
responses:
type: object
additionalProperties:
$ref: '#/components/schemas/SuccessfulPolicyResponse'
BatchMixedResults:
description: Mixed success and failures.
headers:
Content-Encoding:
$ref: '#/components/headers/GzipContentEncoding'
content:
application/json:
schema:
type: object
properties:
batch_decision_id:
type: string
metrics:
type: object
description: If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
additionalProperties: true
responses:
type: object
additionalProperties:
type: object
properties:
http_status_code:
type: string
example: '200'
oneOf:
- $ref: '#/components/schemas/SuccessfulPolicyResponseWithStatusCode'
- $ref: '#/components/schemas/ServerErrorWithStatusCode'
discriminator:
propertyName: http_status_code
mapping:
'200': '#/components/schemas/SuccessfulPolicyResponseWithStatusCode'
'500': '#/components/schemas/ServerErrorWithStatusCode'
BatchServerError:
description: 'Server Error. All requests returned a 500 error.
'
content:
application/json:
schema:
type: object
properties:
batch_decision_id:
type: string
responses:
type: object
additionalProperties:
$ref: '#/components/schemas/ServerError'
BadRequest:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
schemas:
HasStatusCode:
type: object
properties:
http_status_code:
type: string
required:
- http_status_code
ClientError:
type: object
required:
- code
- message
properties:
code:
type: string
message:
type: string
errors:
type: array
items:
type: object
required:
- code
- message
properties:
code:
type: string
message:
type: string
location:
type: object
required:
- file
- row
- col
properties:
file:
type: string
row:
type: integer
col:
type: integer
SuccessfulPolicyResponseWithStatusCode:
allOf:
- $ref: '#/components/schemas/HasStatusCode'
- $ref: '#/components/schemas/SuccessfulPolicyResponse'
provenance:
type: object
description: Provenance information can be requested on individual API calls and are returned inline with the API response. To obtain provenance information on an API call, specify the `provenance=true` query parameter when executing the API call.
properties:
version:
type: string
build_commit:
type: string
build_timestamp:
type: string
format: date-time
build_host:
type: string
bundles:
type: object
additionalProperties:
type: object
title: Revision
required:
- revision
properties:
revision:
type: string
input:
description: Arbitrary JSON used within your policies by accessing `input`
oneOf:
- type: boolean
- type: string
- type: number
- type: array
items: {}
- type: object
additionalProperties: true
example:
user: alice
action: read
object: id123
type: dog
ServerErrorWithStatusCode:
allOf:
- $ref: '#/components/schemas/HasStatusCode'
- $ref: '#/components/schemas/ServerError'
ServerError:
type: object
required:
- code
- message
properties:
code:
type: string
message:
type: string
errors:
type: array
items:
type: object
required:
- code
- message
properties:
code:
type: string
message:
type: string
location:
type: object
required:
- file
- row
- col
properties:
file:
type: string
row:
type: integer
col:
type: integer
decision_id:
type: string
example: b84cf736-213c-4932-a8e4-bb5c648f1b4d
result:
description: The base or virtual document referred to by the URL path. If the path is undefined, this key will be omitted.
oneOf:
- type: boolean
- type: string
- type: number
- type: array
items: {}
- type: object
additionalProperties: true
example:
allow: true
user_is_admin: true
user_is_granted: []
SuccessfulPolicyResponse:
type: object
properties:
result:
$ref: '#/components/schemas/result'
metrics:
type: object
description: If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
additionalProperties: true
decision_id:
type: string
description: If decision logging is enabled, this field contains a string that uniquely identifies the decision. The identifier will be included in the decision log event for this decision. Callers can use the identifier for correlation purposes.
provenance:
$ref: '#/components/schemas/provenance'
headers:
GzipContentEncoding:
description: Indicates that the response body is gzip encoded
schema:
type: string
enum:
- gzip
securitySchemes:
bearerAuth:
type: http
scheme: bearer
externalDocs:
description: Enterprise OPA documentation
url: https://docs.styra.com/enterprise-opa
x-openpolicyagent-documentation-url: https://www.openpolicyagent.org/docs/latest/