Open documentation ↗Overview
OPA provides policy-based control for cloud native environments. The following *endpoints* (such as `PUT /v1/policies`) provide reference documentation for the OPA REST API. ### API specification viewing options - **[View the specification in *Redoc* (default)](index.html)** - **[View the specification in *Swagger UI*](swagger-ui.html)**
Open Policy Agent (OPA) REST API is an open data API from openpolicy.local. It needs no API key. It is served over HTTPS. Its OpenAPI description documents 16 endpoints.
At a glance
- Authentication
- No auth
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Open Data
- Base URL
http://openpolicy.local- Version
- 0.28.0
- Endpoints
- 16
- OpenAPI
- Specification ↗
- Spec updated
- 2023-03-06
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "http://openpolicy.local/health" \
-H "Accept: application/json"const response = await fetch("http://openpolicy.local/health", {
method: "GET",
headers: {
"Accept": "application/json",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"http://openpolicy.local/health",
headers={
"Accept": "application/json",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| POST | / | Execute a simple query |
| GET | /health | Health |
| POST | /v0/data/{path} | Get a document (with webhook) |
| POST | /v1/compile | Compile |
| GET | /v1/config | Get configurations |
| GET | /v1/data/{path} | Get a document |
| POST | /v1/data/{path} | Get a document (with input) |
| PUT | /v1/data/{path} | Create or overwrite a document |
| PATCH | /v1/data/{path} | Update a document |
| DELETE | /v1/data/{path} | Delete a document |
| GET | /v1/policies | List policies |
| GET | /v1/policies/{id} | Get a policy module |
| PUT | /v1/policies/{id} | Create or update a policy module |
| DELETE | /v1/policies/{id} | Delete a policy module |
| GET | /v1/query | Execute an ad-hoc query (simple) |
| POST | /v1/query | Execute an ad-hoc query (complex) |
Questions
Does the Open Policy Agent (OPA) REST API API need an API key?
No. The Open Policy Agent (OPA) REST API API can be called without an API key or sign-up, which makes it handy for prototypes and front-end demos.
Does the Open Policy Agent (OPA) REST API API support HTTPS?
Yes, the Open Policy Agent (OPA) REST API API is served over HTTPS.
How many endpoints does the Open Policy Agent (OPA) REST API API have?
Its OpenAPI description lists 16 endpoints in version 0.28.0. All of them are shown on this page.
What are alternatives to the Open Policy Agent (OPA) REST API API?
Other Open Data APIs include Search Services, Wayback API, Wikipedia, Nasdaq Data Link, University of Oslo.
Similar open data APIs
Compare alternatives →Search Services
Open DataAPI for Internet Archive's Search-related services
Wayback API
Open DataAPI for Internet Archive's Wayback Machine
Wikipedia
Open DataMediawiki Encyclopedia
Nasdaq Data Link
Open DataThe source for financial, economic, and alternative datasets, serving investment professionals.
University of Oslo
Open DataCourses, lecture videos, detailed information for courses etc. for the University of Oslo (Norway)
Data API
Open DataServes the Clever Data API
Listed from APIs.guru (CC0).