API Reference
Reference the core REST and HTTP API surfaces for configuring Bloqr AI and integrating it into your applications. Use this page to find endpoints, payloads, and examples.
Overview
This reference covers the core REST and HTTP API surfaces you use to configure Bloqr AI, manage rules, and integrate streaming or batch workflows into your applications. It is designed as a starter kit template, so you can adapt endpoint names, payload shapes, and policy fields to match your implementation.
Bloqr Systems organizes API access around authentication, configuration, policy evaluation, and event delivery. You can use the examples on this page as a safe baseline for your own documentation.
Use this page as a starting point. Replace endpoint paths, field names, and response shapes with the ones used by your own service.
Key Areas
Authentication
Learn how to send API keys, tokens, and signed requests with each call.
Configuration
Review endpoints for enabling products, toggling behavior, and updating defaults.
Rules and Policies
Define how content is reviewed, filtered, or allowed through your system.
Streaming and Batch
Compare real-time and bulk processing patterns for high-volume workloads.
Authentication
Most requests use a bearer token in the Authorization header. You should also send Content-Type: application/json for requests with a body. In production, keep credentials in environment variables and rotate them regularly.
curl -X POST "https://api.example.com/v1/rules/validate" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"input":"Review this request before it reaches the model."}'
const response = await fetch("https://api.example.com/v1/rules/validate", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
input: "Review this request before it reaches the model."
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://api.example.com/v1/rules/validate",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"input": "Review this request before it reaches the model."
}
)
print(response.json())
Request format
Use JSON for most configuration, policy, and batch requests. Keep field names consistent across your API so clients can reuse the same payload structure in multiple contexts.
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Send Bearer YOUR_TOKEN for authenticated requests. |
| Content-Type | Yes | Use application/json when you send JSON payloads. |
| Accept | No | Set to application/json to prefer JSON responses. |
Configuration Endpoints
You typically use configuration endpoints to enable features, set defaults, and define runtime behavior. The exact resources can vary by product, but the patterns below work well for most API designs.
Fetch current settings
Request the active configuration first so you can show users the current state before making changes.
curl -X GET "https://api.example.com/v1/configuration" \
-H "Authorization: Bearer YOUR_TOKEN"
Update a setting
Send a targeted patch request to update a single value without replacing the full object.
curl -X PATCH "https://api.example.com/v1/configuration" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"defaultMode": "protect",
"logLevel": "summary"
}'
Verify the response
Confirm the server accepted the change and returns the effective configuration for the caller.
Example payload
{
"defaultMode": "protect",
"streaming": true,
"samplingRate": 0.25,
"allowedSources": ["internal", "trusted-partner"]
}
Rules and Policy Endpoints
Policy endpoints help you create, inspect, validate, and version the rules that govern request handling. You can use them to model content checks, routing decisions, and safety filters.
Use this pattern when you need to test a policy before publishing it.
curl -X POST "https://api.example.com/v1/rules/validate" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"rule": {
"name": "block_sensitive_data",
"match": "contains",
"value": "credit card"
}
}'
A successful response usually returns a boolean result plus a validation summary.
Use this pattern to retrieve the active rule set for a workspace or project.
curl -X GET "https://api.example.com/v1/policies" \
-H "Authorization: Bearer YOUR_TOKEN"
This is helpful when you want to compare policy versions or build an admin UI.
Use this pattern when you need to add a new policy entry.
curl -X POST "https://api.example.com/v1/policies/rules" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "redact_contact_info",
"enabled": true,
"pattern": "[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}"
}'
Keep rule names short and descriptive so you can search and audit them later.
Common fields
| Field | Type | Purpose |
|---|---|---|
| name | string | Human-readable rule identifier. |
| enabled | boolean | Controls whether the rule is active. |
| pattern | string | Pattern or expression used to match input. |
| action | string | Describes what happens when the rule matches. |
If you support versioned policies, return a revision number in every write response so clients can detect drift.
Streaming and Batch Operations
Use streaming when you need low-latency decisions for user-facing flows. Use batch operations when you need to process many items at once, such as historical scans, nightly jobs, or import workflows.
Streaming example
curl -N -X POST "https://api.example.com/v1/stream" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"input": "Analyze this message in real time."
}'
Batch example
curl -X POST "https://api.example.com/v1/batch/jobs" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"id": "msg_1001", "input": "First message"},
{"id": "msg_1002", "input": "Second message"}
]
}'
Response shape
{
"jobId": "job_8f3c21",
"status": "queued",
"submittedAt": "2026-10-26T12:00:00Z",
"itemCount": 2
}
Parameters and Response Fields
Use these templates when you document request and response schemas. They help readers understand which fields are required and how to interpret returned values.
Request parameters
Bearer token used to authenticate the request.
The content you want Bloqr AI to evaluate.
Optional evaluation mode, such as protect or observe.
Response fields
The final result of the evaluation.
An array of rules that matched the input.
A unique identifier for tracing and support.
Best Practices
Never place real secrets in examples. Use placeholders such as YOUR_TOKEN, YOUR_API_KEY, and YOUR_SECRET when you document authentication.
Next Steps
After you confirm the API shape, replace the sample paths and field names with your actual implementation details. You can then expand this page into endpoint-specific references for configuration, rules, notifications, and integrations.