Dry-runs a schema/mapping over sample payloads — no writes.
POST
/
v1
/
schemas
/
check
import olira
olira.init(api_key="YOUR_API_KEY")
result = olira.check_schema(
examples=[{"reading_value": 42, "unit": "lux"}],
schema={
"type": "object",
"required": ["reading_value"],
"properties": {"reading_value": {"type": "number"}},
},
mapping={
"targets": [
{"target_subtype": "heart_rate_data", "field_mappings": [{"target": "avg_bpm", "source": "reading_value"}]},
],
},
)
print(result.ok)
using Olira;
OliraModule.Init(apiKey: "YOUR_API_KEY");
var result = OliraModule.CheckSchema(
examples:
[
new Dictionary<string, object?> { ["reading_value"] = 42, ["unit"] = "lux" },
],
schema: new Dictionary<string, object?>
{
["type"] = "object",
["required"] = new List<object?> { "reading_value" },
["properties"] = new Dictionary<string, object?>
{
["reading_value"] = new Dictionary<string, object?> { ["type"] = "number" },
},
},
mapping: new Dictionary<string, object?>
{
["targets"] = new List<object?>
{
new Dictionary<string, object?>
{
["target_subtype"] = "heart_rate_data",
["field_mappings"] = new List<object?>
{
new Dictionary<string, object?>
{
["target"] = "avg_bpm",
["source"] = "reading_value",
},
},
},
},
});
Console.WriteLine(result.Ok);
POST /v1/schemas/check
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"examples": [{"reading_value": 42, "unit": "lux"}],
"payload_schema": {
"type": "object",
"required": ["reading_value"],
"properties": {"reading_value": {"type": "number"}}
},
"mapping": {
"targets": [
{"target_subtype": "heart_rate_data", "field_mappings": [{"target": "avg_bpm", "source": "reading_value"}]}
]
}
}
SchemaCheckResult(
ok=True,
results=[
SchemaCheckExampleResult(
input={"reading_value": 42, "unit": "lux"},
ok=True,
mapped_events=[
{"subtype": "heart_rate_data", "payload": {"avg_bpm": 42}, "metadata": {}, "idempotency_key": None},
],
errors=[],
),
],
error=None,
)
{
"error": true,
"status_code": 401,
"error_type": "authentication_error",
"message": "Could not validate credentials",
"details": [
{
"type": "authentication_error",
"message": "Could not validate credentials"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 403,
"error_type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint",
"details": [
{
"type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 404,
"error_type": "not_found_error",
"message": "Patient not found",
"details": [
{
"type": "not_found_error",
"message": "Patient not found"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 422,
"error_type": "validation_error",
"message": "Request validation failed (1 error)",
"details": [
{
"type": "missing",
"message": "Field required",
"field": "patient_id",
"location": ["body", "patient_id"],
"input_value": null
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 429,
"error_type": "server_error",
"message": "Rate limit exceeded",
"details": [
{
"type": "rate_limit",
"message": "Too many requests; retry after backoff"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 500,
"error_type": "internal_server_error",
"message": "An internal server error occurred",
"details": [
{
"type": "internal_server_error",
"message": "An unexpected error occurred while processing your request"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
olira.check_schema(
examples: list[dict],
subtype: str | None = None,
version: int | None = None,
schema: dict | None = None,
mapping: dict | None = None,
) -> SchemaCheckResult
OliraModule.CheckSchema(
IReadOnlyList<dict> examples,
string? subtype = null,
int? version = null,
dict? schema = null,
dict? mapping = null,
) // -> SchemaCheckResult
api:org-config
Pass subtype (optionally with version) to check a stored or still-pending spec, or pass schema/mapping inline to check a candidate before registering it at all. Runs the same org gate, pure mapping engine, and platform-catalog gate the live ingest route uses, so a green check genuinely predicts what logging would accept.
Parameters
list[dict]
required
Sample payloads to run through.
str | None
default:"None"
Load the active (or pinned version) schema/mapping for this subtype as the baseline.
int | None
default:"None"
Pin a specific version instead of the active one.
dict | None
default:"None"
Inline schema, overriding or replacing the stored one.
dict | None
default:"None"
Inline mapping, overriding or replacing the stored one.
Returns
SchemaCheckResult
bool
True only if every example passed.
list[SchemaCheckExampleResult]
Per-example outcome.
dict
The example payload.
bool
Whether this example passed.
list[dict]
Produced platform events (subtype + payload), if mapping succeeded.
list[str]
Schema/mapping/platform-catalog errors, if any.
Raises
| Exception | When |
|---|---|
AuthError | HTTP 401 or 403 — invalid API key or insufficient OAuth scope for this endpoint. |
ValidationError | HTTP 400, 404, or 422 — malformed JSON, unknown patient, or validation failure (message includes response excerpt). |
ServerError | HTTP 409 (e.g. conflicting external identifier) or repeated 5xx after retries; includes status_code when applicable. |
RateLimitError | HTTP 429 — rate limited; check retry_after (seconds). |
NetworkError | Connection timeout, DNS failure, or read error after retries. |
import olira
olira.init(api_key="YOUR_API_KEY")
result = olira.check_schema(
examples=[{"reading_value": 42, "unit": "lux"}],
schema={
"type": "object",
"required": ["reading_value"],
"properties": {"reading_value": {"type": "number"}},
},
mapping={
"targets": [
{"target_subtype": "heart_rate_data", "field_mappings": [{"target": "avg_bpm", "source": "reading_value"}]},
],
},
)
print(result.ok)
using Olira;
OliraModule.Init(apiKey: "YOUR_API_KEY");
var result = OliraModule.CheckSchema(
examples:
[
new Dictionary<string, object?> { ["reading_value"] = 42, ["unit"] = "lux" },
],
schema: new Dictionary<string, object?>
{
["type"] = "object",
["required"] = new List<object?> { "reading_value" },
["properties"] = new Dictionary<string, object?>
{
["reading_value"] = new Dictionary<string, object?> { ["type"] = "number" },
},
},
mapping: new Dictionary<string, object?>
{
["targets"] = new List<object?>
{
new Dictionary<string, object?>
{
["target_subtype"] = "heart_rate_data",
["field_mappings"] = new List<object?>
{
new Dictionary<string, object?>
{
["target"] = "avg_bpm",
["source"] = "reading_value",
},
},
},
},
});
Console.WriteLine(result.Ok);
POST /v1/schemas/check
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"examples": [{"reading_value": 42, "unit": "lux"}],
"payload_schema": {
"type": "object",
"required": ["reading_value"],
"properties": {"reading_value": {"type": "number"}}
},
"mapping": {
"targets": [
{"target_subtype": "heart_rate_data", "field_mappings": [{"target": "avg_bpm", "source": "reading_value"}]}
]
}
}
SchemaCheckResult(
ok=True,
results=[
SchemaCheckExampleResult(
input={"reading_value": 42, "unit": "lux"},
ok=True,
mapped_events=[
{"subtype": "heart_rate_data", "payload": {"avg_bpm": 42}, "metadata": {}, "idempotency_key": None},
],
errors=[],
),
],
error=None,
)
{
"error": true,
"status_code": 401,
"error_type": "authentication_error",
"message": "Could not validate credentials",
"details": [
{
"type": "authentication_error",
"message": "Could not validate credentials"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 403,
"error_type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint",
"details": [
{
"type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 404,
"error_type": "not_found_error",
"message": "Patient not found",
"details": [
{
"type": "not_found_error",
"message": "Patient not found"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 422,
"error_type": "validation_error",
"message": "Request validation failed (1 error)",
"details": [
{
"type": "missing",
"message": "Field required",
"field": "patient_id",
"location": ["body", "patient_id"],
"input_value": null
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 429,
"error_type": "server_error",
"message": "Rate limit exceeded",
"details": [
{
"type": "rate_limit",
"message": "Too many requests; retry after backoff"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 500,
"error_type": "internal_server_error",
"message": "An internal server error occurred",
"details": [
{
"type": "internal_server_error",
"message": "An unexpected error occurred while processing your request"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
⌘I
import olira
olira.init(api_key="YOUR_API_KEY")
result = olira.check_schema(
examples=[{"reading_value": 42, "unit": "lux"}],
schema={
"type": "object",
"required": ["reading_value"],
"properties": {"reading_value": {"type": "number"}},
},
mapping={
"targets": [
{"target_subtype": "heart_rate_data", "field_mappings": [{"target": "avg_bpm", "source": "reading_value"}]},
],
},
)
print(result.ok)
using Olira;
OliraModule.Init(apiKey: "YOUR_API_KEY");
var result = OliraModule.CheckSchema(
examples:
[
new Dictionary<string, object?> { ["reading_value"] = 42, ["unit"] = "lux" },
],
schema: new Dictionary<string, object?>
{
["type"] = "object",
["required"] = new List<object?> { "reading_value" },
["properties"] = new Dictionary<string, object?>
{
["reading_value"] = new Dictionary<string, object?> { ["type"] = "number" },
},
},
mapping: new Dictionary<string, object?>
{
["targets"] = new List<object?>
{
new Dictionary<string, object?>
{
["target_subtype"] = "heart_rate_data",
["field_mappings"] = new List<object?>
{
new Dictionary<string, object?>
{
["target"] = "avg_bpm",
["source"] = "reading_value",
},
},
},
},
});
Console.WriteLine(result.Ok);
POST /v1/schemas/check
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"examples": [{"reading_value": 42, "unit": "lux"}],
"payload_schema": {
"type": "object",
"required": ["reading_value"],
"properties": {"reading_value": {"type": "number"}}
},
"mapping": {
"targets": [
{"target_subtype": "heart_rate_data", "field_mappings": [{"target": "avg_bpm", "source": "reading_value"}]}
]
}
}
SchemaCheckResult(
ok=True,
results=[
SchemaCheckExampleResult(
input={"reading_value": 42, "unit": "lux"},
ok=True,
mapped_events=[
{"subtype": "heart_rate_data", "payload": {"avg_bpm": 42}, "metadata": {}, "idempotency_key": None},
],
errors=[],
),
],
error=None,
)
{
"error": true,
"status_code": 401,
"error_type": "authentication_error",
"message": "Could not validate credentials",
"details": [
{
"type": "authentication_error",
"message": "Could not validate credentials"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 403,
"error_type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint",
"details": [
{
"type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 404,
"error_type": "not_found_error",
"message": "Patient not found",
"details": [
{
"type": "not_found_error",
"message": "Patient not found"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 422,
"error_type": "validation_error",
"message": "Request validation failed (1 error)",
"details": [
{
"type": "missing",
"message": "Field required",
"field": "patient_id",
"location": ["body", "patient_id"],
"input_value": null
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 429,
"error_type": "server_error",
"message": "Rate limit exceeded",
"details": [
{
"type": "rate_limit",
"message": "Too many requests; retry after backoff"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 500,
"error_type": "internal_server_error",
"message": "An internal server error occurred",
"details": [
{
"type": "internal_server_error",
"message": "An unexpected error occurred while processing your request"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}

