Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Preview installation text detector transport

Generated from the checked-in source. Do not edit this reference by hand.

POST /api/v1/guardrails/detectors/{detector}/preview

Installation administrator only. Explicit consent and the current configuration fingerprint are required before supplied synthetic text is sent to the configured external detector. Does not activate a detector or enforce a policy; no customer billing integration. A detector-unavailable result is a 200 indeterminate outcome, not proof of successful inspection. Cache-Control: no-store.

Operation: previewGuardrailDetector.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/api/v1/guardrails/detectors/{detector}/preview" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required.

JSON
{
"type": "string"
}

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"configuration_fingerprint",
"text",
"consent_to_external_processing"
],
"properties": {
"configuration_fingerprint": {
"type": "string"
},
"text": {
"type": "string"
},
"consent_to_external_processing": {
"type": "boolean"
}
}
}

Declared metadata or synthetic result; Cache-Control: no-store

Response headers:

JSON
{
"Cache-Control": {
"schema": {
"type": "string"
},
"description": "no-store"
}
}

Content type: application/json.

JSON
{
"type": "object",
"required": [
"outcome",
"reason",
"synthetic",
"enforcement"
],
"properties": {
"outcome": {
"type": "string",
"enum": [
"clear",
"matched",
"indeterminate"
]
},
"reason": {
"type": "string"
},
"synthetic": {
"type": "boolean",
"enum": [
true
]
},
"enforcement": {
"type": "boolean",
"enum": [
false
]
}
}
}

Malformed JSON, unknown fields, invalid content or missing/stale explicit consent

Invalid management credential; inference credentials cannot access management endpoints

Insufficient workspace permission or installation administrator authorization

Configured detector not found

Authorization/storage unavailable

Installation administrator only. Explicit consent and the current configuration fingerprint are required before supplied synthetic text is sent to the configured external detector. Does not activate a detector or enforce a policy; no customer billing integration. A detector-unavailable result is a 200 indeterminate outcome, not proof of successful inspection. Cache-Control: no-store.

Supported scope: implemented