AdvancedAPI Reference

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

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."}'

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.

HeaderRequiredDescription
AuthorizationYesSend Bearer YOUR_TOKEN for authenticated requests.
Content-TypeYesUse application/json when you send JSON payloads.
AcceptNoSet 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.

Common fields

FieldTypePurpose
namestringHuman-readable rule identifier.
enabledbooleanControls whether the rule is active.
patternstringPattern or expression used to match input.
actionstringDescribes 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

header
Authorizationstring
Required

Bearer token used to authenticate the request.

body
inputstring
Required

The content you want Bloqr AI to evaluate.

body
modestring

Optional evaluation mode, such as protect or observe.

Response fields

decisionstring
Required

The final result of the evaluation.

matchedRulesarray

An array of rules that matched the input.

requestIdstring
Required

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.